Example #1
0
        private static IDbConnection GetDatabaseConnectionSDS(string cs)
        {
            var rv = new System.Data.SQLite.SQLiteConnection(cs);

            if (rv == null)
            {
                throw new ArgumentException("no connection");
            }
            rv.Open();

            try {
                rv.SetChunkSize(GROW_SIZE);
            }
            catch (Exception ex) {
                log4net.LogManager.GetLogger(typeof(Sqlite)).Error(
                    "Failed to sqlite control", ex);
            }

            if (clearPool == null)
            {
                clearPool = conn =>
                {
                    System.Data.SQLite.SQLiteConnection.ClearPool(
                        conn as System.Data.SQLite.SQLiteConnection);
                };
            }
            return(rv);
        }
Example #2
0
    private static IDbConnection GetDatabaseConnectionSDS(string cs)
    {
      var rv = new System.Data.SQLite.SQLiteConnection(cs);
      if (rv == null) {
        throw new ArgumentException("no connection");
      }
      rv.Open();

      try {
        rv.SetChunkSize(GROW_SIZE);
      }
      catch (Exception ex) {
        log4net.LogManager.GetLogger(typeof(Sqlite)).Error(
          "Failed to sqlite control", ex);
      }

      if (clearPool == null) {
        clearPool = conn =>
        {
          System.Data.SQLite.SQLiteConnection.ClearPool(
            conn as System.Data.SQLite.SQLiteConnection);
        };
      }
      return rv;
    }