You are not logged in.
I'm currently implimenting Buisness Administration functionality to an almost completed Booking System project using mORMot and SQLite.
The Client uses a web javascript front end, and the Admin functions will be provided by a Delphi VCL Client (doing that now). I've just started to impliment User Management, and I'm confused regarding errors with the TSQLAuthGroup, TSQLAuthUser tables with respect to VirtualTableExternal and CreateMissingTables.
The server side code is :
{1} DBProps := TSQLDBSQLite3ConnectionProperties.Create('PopitBookings.DB3','','','');
{2} Model := CreateSampleModel;
{3} VirtualTableExternalRegisterAll(Model, DBProps);
{4} PopitDB := TSQLRestServerDB.Create(Model, 'PopitBookings.db3', False);
{5} PopitDB.CreateMissingTables; // error here
...
Prior to implementing the Auth tables, I could delete the Bookings.db3 file and, on running the server, a new database was created as expected.
After adding the Auth Tables - Model Creation is now :
TSQLModel.Create([TSQLAuthGroup, TSQLAuthUser, and the other 7 tables ... ]);
And now I get an exception after Line 5 (CreateMissingTables) that tells me the Database is busy :
"Error SQLITE_BUSY using 3.28.0 - database is locked ...".
If I omitt line 3, the Auth tables are created as part of the database, but not populated wit Auth records.
I've read the SAD over and over, but have had no success in figuring out how to resolve this issue, or understanding why my approach is wrong.
Any help/advice would be greatly appreciated (mORMot version : 1.18.5232).
Last edited by Horbs (2019-06-02 10:27:04)
Offline
Offline
Thank you AB - that fixed it.
But still had a problem in that the Auth tables were empty.
Fixed by moving "Model := CreateSampleModel;" to the first line.
Horbs
Offline