@@ -94,58 +94,6 @@ final class NativeSqliteDatabaseImpl extends SqliteDatabaseImpl {
9494 }
9595 }
9696
97- /// Open a read-only transaction.
98- ///
99- /// Up to [maxReaders] read transactions can run concurrently.
100- /// After that, read transactions are queued.
101- ///
102- /// Read transactions can run concurrently to a write transaction.
103- ///
104- /// Changes from any write transaction are not visible to read transactions
105- /// started before it.
106- @override
107- Future <T > readTransaction <T >(
108- Future <T > Function (SqliteReadContext tx) callback,
109- {Duration ? lockTimeout}) async {
110- return _useConnection (
111- writer: false ,
112- abortTrigger: lockTimeout? .asTimeout,
113- debugContext: 'readTransaction' ,
114- (context) {
115- return _transactionInLease (context, callback);
116- },
117- );
118- }
119-
120- /// Open a read-write transaction.
121- ///
122- /// Only a single write transaction can run at a time - any concurrent
123- /// transactions are queued.
124- ///
125- /// The write transaction is automatically committed when the callback finishes,
126- /// or rolled back on any error.
127- @override
128- Future <T > writeTransaction <T >(
129- Future <T > Function (SqliteWriteContext tx) callback,
130- {Duration ? lockTimeout}) {
131- return _useConnection (
132- writer: true ,
133- abortTrigger: lockTimeout? .asTimeout,
134- debugContext: 'writeTransaction' ,
135- (context) {
136- return _transactionInLease (context, callback);
137- },
138- );
139- }
140-
141- Future <T > _transactionInLease <T >(
142- _LeasedContext context,
143- Future <T > Function (SqliteWriteContext tx) callback,
144- ) {
145- final ctx = ScopedWriteContext (context);
146- return ctx.writeTransaction (callback).whenComplete (ctx.invalidate);
147- }
148-
14997 @override
15098 Future <T > abortableReadLock <T >(
15199 Future <T > Function (SqliteReadContext tx) callback,
0 commit comments