drift icon indicating copy to clipboard operation
drift copied to clipboard

SqliteException(5): database is locked

Open nicodanke opened this issue 3 years ago • 13 comments

I am currently working on a project that use both drift and sqlite3 to store data locally in a database. In production and only in Android phones throws this error: SqliteException(5): database is locked.

The complete stacktrace is as follow:

Screen Shot 2022-09-02 at 10 09 35

Nw: SqliteException(5): database is locked Causing statement: DELETE FROM customer_table; libapp 0xdfe0d312 DriftCommunication.request (communication.dart:109) libapp 0xe01b83e8 _BaseExecutor._runRequest (client_impl.dart:75) libapp 0xe01be328 _BaseExecutor.runDelete (client_impl.dart:92) libapp 0xe01be380 LazyDatabase.runDelete (lazy_database.dart:74) libapp 0xe0312890 DeleteStatement.go.<T> (delete.dart:41) libapp 0xdfe26df4 DeleteStatement.go.<T> (delete.dart:40) libapp 0xdfdf43b0 DatabaseConnectionUser.doWhenOpened.<T> (connection_user.dart:160) libapp 0xdfe0f114 Stream.firstWhere.<T>.<T> (stream.dart:1659) libapp 0xe042aaa0 StackZoneSpecification._run (stack_zone_specification.dart:208) libapp 0xe02e2e50 StackZoneSpecification._registerUnaryCallback.<T> (stack_zone_specification.dart:126) libapp 0xe02e7ab4 _rootRunUnary (zone.dart:1434) libapp 0xdfdad280 _rootRunUnary (zone.dart) libapp 0xdfdad644 _CustomZone.runUnary (zone.dart:1335) libapp 0xdfdad644 _FutureListener.handleValue (future_impl.dart:147) libapp 0xe02e7d34 Future._propagateToListeners.handleValueCallback (future_impl.dart:766) libapp 0xdfda9014 Future._propagateToListeners (future_impl.dart:795) libapp 0xdfda8b08 Future._completeWithValue (future_impl.dart:566) libapp 0xdfdadb84 Future._asyncCompleteWithValue.<T> (future_impl.dart:639) libapp 0xe042aaa0 StackZoneSpecification._run (stack_zone_specification.dart:208) libapp 0xe02e31f4 StackZoneSpecification._registerCallback.<T> (stack_zone_specification.dart:116) libapp 0xe02e82c0 _rootRun (zone.dart:1426) libapp 0xdfdad800 _rootRun (zone.dart) libapp 0xe0260ae4 _CustomZone.run (zone.dart:1328) libapp 0xe0408098 _CustomZone.runGuarded (zone.dart:1236) libapp 0xe0264e58 _CustomZone.bindCallbackGuarded.<T> (zone.dart:1276) libapp 0xdfda87a8 _microtaskLoop (schedule_microtask.dart:40) libapp 0xe02e4fb8 _startMicrotaskLoop (schedule_microtask.dart:49) libapp 0xdfda8730 _startMicrotaskLoop (schedule_microtask.dart) File "" libapp 0xe02e2290 StackZoneSpecification._currentTrace (stack_zone_specification.dart:223) libapp 0xe02e21c8 StackZoneSpecification._createNode (stack_zone_specification.dart:196) libapp 0xe02e2114 StackZoneSpecification._errorCallback (stack_zone_specification.dart:182) libapp 0xe02e2038 StackZoneSpecification._errorCallback (stack_zone_specification.dart) libapp 0xe0265f54 _CustomZone.errorCallback (zone.dart:1374) libapp 0xdfdb3dd8 _Completer.completeError (future_impl.dart:16) libapp 0xe0269694 _PendingRequest.completeWithError (communication.dart:182) libapp 0xe02695b0 DriftCommunication._handleMessage (communication.dart:88) libapp 0xe02693a4 DriftCommunication._handleMessage (communication.dart) libapp 0xdfe0f114 Stream.firstWhere.<T>.<T> (stream.dart:1659) libapp 0xe042aaa0 StackZoneSpecification._run (stack_zone_specification.dart:208) libapp 0xe02e2e50 StackZoneSpecification._registerUnaryCallback.<T> (stack_zone_specification.dart:126) libapp 0xe02e7ab4 _rootRunUnary (zone.dart:1434) libapp 0xdfdad280 _rootRunUnary (zone.dart) libapp 0xe0260c5c _CustomZone.runUnary (zone.dart:1335) libapp 0xe0408208 _CustomZone.runUnaryGuarded (zone.dart:1244) libapp 0xe023e7a0 _BufferingStreamSubscription._sendData (stream_impl.dart:341) libapp 0xe01c3998 _BufferingStreamSubscription._add (stream_impl.dart:271) libapp 0xe01c36f0 _SyncStreamControllerDispatch._sendData (stream_controller.dart:774) libapp 0xe01c36f0 _StreamController._add (stream_controller.dart:648) libapp 0xe035393c _StreamController.add (stream_controller.dart:596) libapp 0xdfdd7848 _Closure._function_type_arguments= (stream_controller.dart) libapp 0xdfe0f114 Stream.firstWhere.<T>.<T> (stream.dart:1659) libapp 0xe042aaa0 StackZoneSpecification._run (stack_zone_specification.dart:208) libapp 0xe02e2e50 StackZoneSpecification._registerUnaryCallback.<T> (stack_zone_specification.dart:126) libapp 0xe02e7ab4 _rootRunUnary (zone.dart:1434) libapp 0xdfdad280 _rootRunUnary (zone.dart) libapp 0xe0260c5c _CustomZone.runUnary (zone.dart:1335) libapp 0xe0408208 _CustomZone.runUnaryGuarded (zone.dart:1244) libapp 0xe023e7a0 _BufferingStreamSubscription._sendData (stream_impl.dart:341) libapp 0xe01c3998 _BufferingStreamSubscription._add (stream_impl.dart:271) libapp 0xe01c36f0 _SyncStreamControllerDispatch._sendData (stream_controller.dart:774) libapp 0xe01c36f0 _StreamController._add (stream_controller.dart:648) libapp 0xe035393c _StreamController.add (stream_controller.dart:596) libapp 0xe0354718 _StreamSinkWrapper.add (stream_controller.dart:867) libapp 0xe035d98c _GuaranteeSink.add (guarantee_channel.dart:125) libapp 0xdfe0e020 DriftIsolate._open.<T> (isolate.dart:78) libapp 0xdfe0f114 Stream.firstWhere.<T>.<T> (stream.dart:1659) libapp 0xe042aaa0 StackZoneSpecification._run (stack_zone_specification.dart:208) libapp 0xe02e2e50 StackZoneSpecification._registerUnaryCallback.<T> (stack_zone_specification.dart:126) libapp 0xe02e7b38 _rootRunUnary (zone.dart:1442) libapp 0xdfdad280 _rootRunUnary (zone.dart) libapp 0xe0260c5c _CustomZone.runUnary (zone.dart:1335) libapp 0xe0408208 _CustomZone.runUnaryGuarded (zone.dart:1244) libapp 0xe023e7a0 _BufferingStreamSubscription._sendData (stream_impl.dart:341) libapp 0xe01c3998 _BufferingStreamSubscription._add (stream_impl.dart:271) libapp 0xe01c36f0 _SyncStreamControllerDispatch._sendData (stream_controller.dart:774) libapp 0xe01c36f0 _StreamController._add (stream_controller.dart:648) libapp 0xe035393c _StreamController.add (stream_controller.dart:596) libapp 0xdfdd7848 _Closure._function_type_arguments= (stream_controller.dart) libapp 0xdfdaa32c _RawReceivePortImpl._handleMessage (isolate_patch.dart:192) File "" libapp 0xe02e2290 StackZoneSpecification._currentTrace (stack_zone_specification.dart:223) libapp 0xe02e21c8 StackZoneSpecification._createNode (stack_zone_specification.dart:196) libapp 0xe02e2bc0 StackZoneSpecification._registerUnaryCallback (stack_zone_specification.dart:124) libapp 0xe02e2ae8 StackZoneSpecification._registerUnaryCallback (stack_zone_specification.dart) libapp 0xe0265dc0 RenderMouseRegion.onEnter (zone.dart:1356) libapp 0xe0232318 _BufferingStreamSubscription._registerDataHandler (stream_impl.dart:134) libapp 0xe0232170 _BufferingStreamSubscription.zoned (stream_impl.dart:108) libapp 0xe02320e8 _BufferingStreamSubscription (stream_impl.dart:103) libapp 0xe0238128 _ControllerSubscription (stream_controller.dart:847) libapp 0xe0238128 _StreamController._subscribe (stream_controller.dart:678) libapp 0xe024b9cc _ControllerStream._createSubscription (stream_controller.dart:827) libapp 0xe024c108 _StreamImpl.listen (stream_impl.dart:473) libapp 0xdfe0ce7c DriftCommunication (communication.dart:35) libapp 0xdfe0b150 DriftClient (client_impl.dart:33) libapp 0xdfe0b0c8 remote (remote.dart:129) libapp 0xe0306c48 DriftIsolate.connect (isolate.dart:92) libapp 0xdfe0b078 DriftIsolate.connect (isolate.dart:91) libapp 0xe0428a04 AppDb._sqliteConnectionIsolate.<T> (app_db.dart:142) File "" libapp 0xe02e2290 StackZoneSpecification._currentTrace (stack_zone_specification.dart:223) libapp 0xe02e21c8 StackZoneSpecification._createNode (stack_zone_specification.dart:196) libapp 0xe02e2bc0 StackZoneSpecification._registerUnaryCallback (stack_zone_specification.dart:124) libapp 0xe02e2ae8 StackZoneSpecification._registerUnaryCallback (stack_zone_specification.dart) libapp 0xe02e8f6c _CustomZone.registerUnaryCallback (zone.dart:1356) libapp 0xe02e8f6c _asyncThenWrapperHelper (async_patch.dart:50) libapp 0xe02df8a4 AppDb._sqliteConnectionIsolate.<T> (app_db.dart) libapp 0xe02df438 AppDb._sqliteConnectionIsolate (app_db.dart:143) libapp 0xe02df3d4 AppDb.sqliteConnection (app_db.dart:126) libapp 0xe02df37c registerDependencies.<T> (dependencies.dart:104) libapp 0xe0316cdc _ServiceFactory.getObject (get_it_impl.dart:160) libapp 0xdfe37950 _GetItImplementation.get (get_it_impl.dart:409) libapp 0xe02dedec AppDb (app_db.dart:104) libapp 0xe02dedec GetItInjectableX|$init.<T> (dependencies.config.dart:271) libapp 0xe0316cdc _ServiceFactory.getObject (get_it_impl.dart:160) libapp 0xdfe37950 _GetItImplementation.get (get_it_impl.dart:409) libapp 0xe02da254 GetItInjectableX|$init.<T> (dependencies.config.dart:351) libapp 0xe0316cdc _ServiceFactory.getObject (get_it_impl.dart:160) libapp 0xdfe37950 _GetItImplementation.get (get_it_impl.dart:409) libapp 0xe02da164 RoomRepositoryImpl (room_repository_impl.dart:37) libapp 0xe02da074 GetItInjectableX|$init.<T> (dependencies.config.dart:352) libapp 0xe0316cdc _ServiceFactory.getObject (get_it_impl.dart:160) libapp 0xdfe37950 _GetItImplementation.get (get_it_impl.dart:409) libapp 0xe02d9ee4 _$RoomServiceImpl.repository (room_service_impl.g.dart:18) libapp 0xe02d9ee4 _$RoomServiceImpl (room_service_impl.g.dart:14) libapp 0xe02d9e2c GetItInjectableX|$init.<T> (dependencies.config.dart) libapp 0xe0316cdc _ServiceFactory.getObject (get_it_impl.dart:160) libapp 0xdfe37950 _GetItImplementation.get (get_it_impl.dart:409) libapp 0xe02d4a70 RoomsLogic (rooms_logic.dart:12) libapp 0xe02d4a14 GetGlobalRef.registerDependencies.<T>.<T> (get_ref_global.dart:179) libapp 0xdffe9cfc BinderScopeState.use.<T> (binder_scope.dart:207) libapp 0xdff4aa98 _LinkedHashMapMixin.putIfAbsent (compact_hash.dart:524) libapp 0xdffe9c40 BinderScopeState.use (binder_scope.dart:207) libapp 0xdfff7cf0 Logic.use (logic.dart:47) libapp 0xe00d3880 WarmUpLogic.repositories (warmup_logic.dart:33) libapp 0xe03b9580 WarmUpLogic.doWarmUp (warmup_logic.dart:71) libapp 0xe00d29dc WarmUpLogic.doWarmUp (warmup_logic.dart:64) libapp 0xe03e6d78 WarmUpLogic.load (warmup_logic.dart:108) libapp 0xe01c0164 WarmUpLogic.load (warmup_logic.dart:107) libapp 0xdffe9af4 _LogicLoaderState.load.<T> (logic_loader.dart:76) libapp 0xdff4e0ac MappedIterable.elementAt (iterable.dart:373) libapp 0xe024b1ac ListIterator.moveNext (iterable.dart:342) libapp 0xe0315740 Future.wait (future.dart:519) libapp 0xe038dc2c _LogicLoaderState.load (logic_loader.dart:78) libapp 0xdffe9a48 _LogicLoaderState.load (logic_loader.dart:75) libapp 0xe00496bc _LogicLoaderState.initState.<T> (logic_loader.dart:72) libapp 0xe0305dec SchedulerBinding._invokeFrameCallback (binding.dart:1146) libapp 0xe0305c44 SchedulerBinding.handleDrawFrame (binding.dart:1091) libapp 0xdfe0a7ec SchedulerBinding._handleDrawFrame (binding.dart:997) libapp 0xdfe0a6b8 SchedulerBinding._handleDrawFrame (binding.dart) libapp 0xe02e82c0 _rootRun (zone.dart:1426) libapp 0xdfdad800 _rootRun (zone.dart) libapp 0xe0260ae4 _CustomZone.run (zone.dart:1328) libapp 0xe0408098 _CustomZone.runGuarded (zone.dart:1236) libapp 0xdfdba884 _invoke (hooks.dart:151) libapp 0xdfdc1580 PlatformDispatcher._drawFrame (platform_dispatcher.dart:308) libapp 0xdfdc1544 _drawFrame (hooks.dart:115) libapp 0xdfdc15e0 _drawFrame (hooks.dart)

The version of drift that I am using is: 1.7.1 The version of sqlite3 is: 1.7.2 The version of sqlite3_flutter_libs is 0.5.7 Flutter version: 3.0.3

If anyone can give me al little light about this and how to solve this problem I would be grateful.

nicodanke avatar Sep 02 '22 13:09 nicodanke

It looks like you're using a DriftIsolate, are you opening additional connections to the same sqlite3 file? If you have multiple connections running concurrently (without a DriftIsolate coordinating all of them), there's a chance to run into this issue. If you're just opening the database once this shouldn't happen.

Does this error happen a lot or just occasionally?

simolus3 avatar Sep 02 '22 13:09 simolus3

We use DriftIsolate and open only one connection to sqlite3. This error occurs a lot in production and we can't reproduce it consistently in dev environment.

nicodanke avatar Sep 02 '22 14:09 nicodanke

Hi, in order to add more information about this problem, our app is made in Flutter, and we published it both in iOS and Android. In iOS we are not getting this SqliteException(5): database is locked, this only happens on Android.

nicodanke avatar Sep 08 '22 12:09 nicodanke

We are having the same issue, can we please get a response?

nicobritos avatar Sep 09 '22 17:09 nicobritos

Unfortunately, I still don't have enough information to properly act on this issue, as I've never been able to reproduce it locally or in any of my apps.

Are you able to reproduce this locally or do you see this error on crash reports only @nicobritos? I still think the most likely cause is that you somehow open two NativeDatabases to the same database. Could you check whether that might be happening?

simolus3 avatar Sep 09 '22 19:09 simolus3

Hi @simolus3

Nope. We cant reproduce it locally either, but there doesnt seem to be a particular reason for why this happens. Key points:

  • The issue happens when performing a write query to the DB right after opening the app. Sentry doesn't show other lifecycle events so we assume the app was killed in background or manually closed before opening and seeing the issue.
  • iOS is not affected, in Android this seems to happen in any version (6.0.1, 10, 11, 12).
  • We use Drift in Isolate mode, and instantiate it using GetIt. We never reset the instance. We haven't tested creating an instance outside GetIt on a global variable, but this shouldnt be the problem.
  • We dont know if a failed migration or if the app was killed when writing to the DB, performing a migration or a transaction locks the DB.
  • We only use 1 connection to the DB.
  var dbDisposeCompleter = Completer<void>();
  getIt.registerLazySingleton<QueryExecutor>(
    () => AppDb.sqliteConnection(
      arguments.logger.sqlite,
      arguments.logger.sqliteIsolate,
      asIsolate: dbIsolate,
      onIsolateDispose: dbDisposeCompleter.future,
    ),
    dispose: (sql) async {
      await sql.close();
      if (!dbDisposeCompleter.isCompleted) {
        dbDisposeCompleter.complete();
        dbDisposeCompleter = Completer();
      }
    },
  );


  static QueryExecutor sqliteConnection(bool logStatements, bool logIsolate,
      {bool asIsolate = false, Future? onIsolateDispose}) {
    if (asIsolate) {
      return _sqliteConnectionIsolate(logStatements, logIsolate, onIsolateDispose);
    } else {
      return _sqliteConnectionDirect(logStatements);
    }
  }

  static Future<File> sqliteFile() async {
    // Put the database file in documents folder.
    final dbFolder = await getApplicationDocumentsDirectory();
    return File(join(dbFolder.path, 'db.sqlite'));
  }

  static QueryExecutor _sqliteConnectionIsolate(bool logStatements, bool logIsolate, Future? onIsolateDispose) {
    return DatabaseConnection.delayed(() async {
      final isolate = await _createDriftIsolate(logStatements);
      unawaited(onIsolateDispose?.then((_) => isolate.shutdownAll()));
      return isolate.connect(isolateDebugLog: logIsolate);
    }())
        .executor;
  }

  static LazyDatabase _sqliteConnectionDirect(bool logStatements) {
    return LazyDatabase(() async {
      return NativeDatabase(
        await sqliteFile(),
        logStatements: logStatements,
        setup: (rawDb) {
          rawDb.execute('PRAGMA journal_mode=WAL;');
        },
      );
    });
  }

  static Future<DriftIsolate> _createDriftIsolate(bool logStatements) async {
    final file = await sqliteFile();
    final receivePort = ReceivePort();

    await Isolate.spawn(
      _startBackgroundIsolate,
      _DriftIsolateInitial(receivePort.sendPort, file, logStatements),
    );

    return await receivePort.first;
  }

  static void _startBackgroundIsolate(_DriftIsolateInitial request) {
    final executor = NativeDatabase(
      request.targetFile,
      logStatements: request.logStatements,
      setup: (rawDb) {
        rawDb.execute('PRAGMA journal_mode=WAL;');
      },
    );
    final driftIsolate = DriftIsolate.inCurrent(() => DatabaseConnection(executor));
    request.sendDriftIsolate.send(driftIsolate);
  }
class _DriftIsolateInitial {
  final SendPort sendDriftIsolate;
  final File targetFile;
  final bool logStatements;

  _DriftIsolateInitial(this.sendDriftIsolate, this.targetFile, this.logStatements);
}

Hope that you see something that we are missing! Thanks

nicobritos avatar Sep 09 '22 20:09 nicobritos

Nice call with the completer to stop the drift isolate after closing the database.

Unfortunately, I still don't see any obvious problem. From everything I know, sqlite3 error 5 can only mean that two concurrent processes are using the database. This error should not occur when the database is locked due to misuse in a single connection, or even due to a previous crash or an unexpected process stop.

One thing that stands out: On iOS, we compile sqlite with SQLITE_THREADSAFE=1 (always threadsafe). On Android, we use SQLITE_THREADSAFE=2 (threadsafe as long as two threads don't share a database connection). Technically, two threads should never share a database connection. But I wonder if the isolate group feature, where Dart isolates are multiplexed onto fewer OS threads and might switch across threads, could cause an issue with that option too. As a precaution, I'll release a new version of sqlite3_flutter_libs that also uses SQLITE_THREADSAFE=1 on Android. Then we can check if that changes anything. I think it's worth it just to keep the compile options between Android and iOS in sync.

simolus3 avatar Sep 13 '22 19:09 simolus3

I've just released sqlite3_flutter_libs version 0.5.10, which switches to SQLITE_THREADSAFE=1 on Android as well. If you could use that version and see if it improves the situation at all, that would help a lot!

simolus3 avatar Sep 14 '22 19:09 simolus3

Might also be worth checking if the issue still happens when using a non-WAL journal mode. Note you'll need to explicitly set the journal mode to some non-WAL value (like DELETE), since WAL mode is persistent.

The biggest benefit of WAL mode is that you can have multiple reader connections that don't block each other or the writer connection, so if you're only using one connection you're not really taking full advantage of WAL anyway.

Mike278 avatar Sep 16 '22 19:09 Mike278

First of all, thanks for your answers! We've already migrated to ObjectBox as this was blocking the app's deploy to production on Android, and we were already passed our deadline.

@simolus3 we've tested the new build but as we weren't able to reproduce the issue earlier, we cannot say if it was fixed or not, and a deploy to production of the new build risking breaking the experience to some customers doesn't make sense. However, it begs the question of why the Android's SQLite3 lib was built using SQLITE_THREADSAFE=2 and SQLITE_THREADSAFE=1 in iOS.

@Mike278 you mean removing the line rawDb.execute('PRAGMA journal_mode=WAL;');? Because this was something we've tried to see if the database wouldn't lock, although we knew this was only useful when using multiple (read) connections, but we've wanted to try it anyways. Anyways, it didn't work.

What would be ideal is to find a way to reproduce this issue. However, I'm inclined to think that the lock happens when dart switches threads in the same isolate. Some of this is explained here.

nicobritos avatar Sep 19 '22 02:09 nicobritos

Thanks for your response!

risking breaking the experience to some customers doesn't make sense

Yeah that's definitely understandable.

However, it begs the question of why the Android's SQLite3 lib was built using SQLITE_THREADSAFE=2 and SQLITE_THREADSAFE=1 in iOS.

When I started work on the ffi implementation, I was convinced that SQLITE_THREADSAFE=2 was the right option to use. It most likely was at the time, since isolates didn't switch between multiple OS threads back then. Using SQLITE_THREADSAFE=2 brings a very tiny speed gain since some mutexes can be skipped.

On Android, I had to compile sqlite3 myself, and so I've picked SQLITE_THREADSAFE=2 as a compile-time option. On iOS, we're using an existing pod to compile sqlite3. That pod keeps the default value of SQLITE_THREADSAFE=1 and I didn't see a reason to change that.

That was causing an unfortunate divergence which I've fixed now. We now use the default SQLITE_THREADSAFE=1 on all platforms.

I'm inclined to think that the lock happens when dart switches threads in the same isolate.

Yes, that is my best guess as well. This would explain why this has not been a problem initially, as isolates were bound to a fixed OS thread before Dart 2.15.

simolus3 avatar Sep 19 '22 10:09 simolus3

We have exactly the same problem in production

  • Android only
  • journal_mode=WAL
  • drift: 1.7.1
  • concurrent writing

It's hard to have a reproduction scenario in dev environment.

I try to upgrade to sqlite3_flutter_libs 0.5.10 but I still get the error. To reproduce, I force insert/update requests on separate threads (some in foreground, and on the other in background with the workManager). All threads use the same DatabaseConnection (singleton), but the error always occurs.

I/flutter (31172): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (31172): │ SqliteException(5): database is locked, database is locked (code 5)
I/flutter (31172): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (31172): │ #0   DriftCommunication.request (package:drift/src/remote/communication.dart:109:66)
I/flutter (31172): │ #1   _BaseExecutor._runRequest (package:drift/src/remote/client_impl.dart:75:28)
I/flutter (31172): │ #2   _BaseExecutor.runInsert (package:drift/src/remote/client_impl.dart:102:12)
I/flutter (31172): │ #3   LazyDatabase.runInsert (package:drift/src/utils/lazy_database.dart:78:17)
I/flutter (31172): │ #4   InsertStatement.insert.<anonymous closure> (package:drift/src/runtime/query_builder/statements/insert.dart:74:26)
I/flutter (31172): │ #5   InsertStatement.insert.<anonymous closure> (package:drift/src/runtime/query_builder/statements/insert.dart:73:40)
I/flutter (31172): │ #6   DatabaseConnectionUser.doWhenOpened.<anonymous closure> (package:drift/src/runtime/api/connection_user.dart:160:64)
I/flutter (31172): │ #7   _rootRunUnary (dart:async/zone.dart:1434:47)
I/flutter (31172): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

fresnault avatar Oct 04 '22 09:10 fresnault

@simolus3 I also have the same issue, either the database gets locked or we don't get any values in db

raghavsatyadev avatar May 09 '23 12:05 raghavsatyadev