private void SetValueCore(DatabaseManagement mgmt) { // synchronized insert try { using (Descriptor.AcquireWriteLock()) using (var con = Descriptor.GetConnection()) using (var tr = con.BeginTransaction(DatabaseConnectionHelper.DefaultIsolationLevel)) { con.Execute(this.TableInserter, mgmt); tr.Commit(); } } catch (Exception ex) { throw DatabaseConnectionHelper.WrapException(ex, "SetValueCore", this.TableInserter); } }
internal async Task VacuumAsync() { await Descriptor .GetTaskFactory(true) .StartNew(() => { // should execute WITHOUT transaction. try { using (Descriptor.AcquireWriteLock()) using (var con = Descriptor.GetConnection()) { con.Execute("VACUUM;"); } } catch (Exception ex) { throw DatabaseConnectionHelper.WrapException(ex, "VacuumAsync", this.TableInserter); } }); }