'Database is locked' when using 2 TLiteQuery
Posted: Wed 09 May 2018 21:31
Hi,
I'm trying to hunt down a problem with using the same SQLite-database from more than one application. I made a small test app that has the same behavior/problem.
Setup:
A TForm with TLiteQuery, DBGrid, DBNavigator and TDBEdit:s.
I can instantiate multiple form-objects
All forms work with the same database and table.
TLiteConnection-settings are default except specifying direct read.
TLiteQuery-settings are default. Setting SELECT-statement in SQL-property.
TDataSource has AutoEdit=true.
If I run the application with a single instance of the form, then everything works.
If I instantiate 2 forms, they work with browsing the dataset, and I can modify the records in one of the instances. But as soon as I try to modify anything in the other instance I get a 'database is locked.' error.
It doesn't matter in which form I start editing first, the other is unable to modify any records.
I tried to replace TLiteQuery with TLiteTable, but I have the same behaviour.
Am I doing something wrong setting up the components?
Using:
RAD Studio 10.2 Tokyo (C++ project)
LiteDAC 3.1.3
I'm trying to hunt down a problem with using the same SQLite-database from more than one application. I made a small test app that has the same behavior/problem.
Setup:
A TForm with TLiteQuery, DBGrid, DBNavigator and TDBEdit:s.
I can instantiate multiple form-objects
All forms work with the same database and table.
TLiteConnection-settings are default except specifying direct read.
TLiteQuery-settings are default. Setting SELECT-statement in SQL-property.
TDataSource has AutoEdit=true.
If I run the application with a single instance of the form, then everything works.
If I instantiate 2 forms, they work with browsing the dataset, and I can modify the records in one of the instances. But as soon as I try to modify anything in the other instance I get a 'database is locked.' error.
It doesn't matter in which form I start editing first, the other is unable to modify any records.
I tried to replace TLiteQuery with TLiteTable, but I have the same behaviour.
Am I doing something wrong setting up the components?
Using:
RAD Studio 10.2 Tokyo (C++ project)
LiteDAC 3.1.3