Description
In projects which have the metadatabase attached as per the recommended method inside prepareDatabase along with multi-threaded usage of that database it can result in issues where the meta db is locked.
SQLite error 5: database is locked - while executing `BEGIN IMMEDIATE TRANSACTION`
I believe this is because in the attach method we create a short lived pool and that is not shared between prepare calls so cant properly pool/queue the requests.
Checklist
Expected behavior
No issue
Actual behavior
Intermittent issues
Reproducing project
https://github.com/davidrothera/LockedDatabaseRepro
SQLiteData version information
1.5.1
Sharing version information
No response
GRDB version information
7.9.0
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information
Description
In projects which have the metadatabase attached as per the recommended method inside
prepareDatabasealong with multi-threaded usage of that database it can result in issues where the meta db is locked.I believe this is because in the attach method we create a short lived pool and that is not shared between prepare calls so cant properly pool/queue the requests.
Checklist
mainbranch of this package.Expected behavior
No issue
Actual behavior
Intermittent issues
Reproducing project
https://github.com/davidrothera/LockedDatabaseRepro
SQLiteData version information
1.5.1
Sharing version information
No response
GRDB version information
7.9.0
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information