Example #1
0
 public Task RunInTransactionAsync(Action <SQLiteConnection> action)
 {
     return(Task.Factory.StartNew(() =>
     {
         SQLiteConnectionWithLock conn = this.GetConnection();
         using (conn.Lock())
         {
             conn.BeginTransaction();
             try
             {
                 action(conn);
                 conn.Commit();
             }
             catch (Exception)
             {
                 conn.Rollback();
                 throw;
             }
         }
     }));
 }
Example #2
0
 public void OnApplicationSuspended()
 {
     Connection.Dispose();
     Connection = null;
 }
Example #3
0
 public Entry(SQLiteConnectionString connectionString, SQLiteOpenFlags openFlags)
 {
     ConnectionString = connectionString;
     Connection       = new SQLiteConnectionWithLock(connectionString, openFlags);
 }