You are not logged in.
Pages: 1
when i wirte realtime table into the Server by the Client side .and at the same time i want to open the DB with The SQLite Spy tool,sometimes the Error Message is Database is locked or NOt an Error.
i guess it is that i open the DB frequently?
Offline
The framework is not supposed to handle concurrent access to the same file.
It was designed with the presupposition of being the only one to access the db file.
SQliteSpy is locking the database during its access, therefore the DB access fails from the framework.
Or the contrary....
You can add a call to
aRestServerDB.DB.BusyTimeout := 2000;
to set a waiting time before returning an error...
But the use of the DB file is not meant to be accessible from an external tool during the framework run.
Think as SQLite as a database exchange format, and not as a concurrent access system.
Offline
The problem is that i have an application using SQLite DB today.
And i would like to make the transition gradually...
So. The Sqlite DB would be accessed via REST and also in the traditional way.
Understand? TSQLDBSQLite3ConnectionProperties in legacy applications and TSQLHttpClient in the new model.
Could you show me where the blockage occurs in Sqlite DB? I searched but did not find or did not understand.
Offline
You can share the same TSQLDBSQLite3ConnectionProperties for both direct access and mORMot ORM, as external database.
Simply use TSQLDBSQLite3ConnectionProperties for external access at TSQLRestServer level.
No problem of locking any more.
Offline
But only one application (EXE with build if sqlite3.c) at time can access to SQLite file. This is a SQLite design. There is not some kind of external "instance"(like Oracle listener) what handle concurrency, blocking and so on from different application - all this function are compiled into your application. So if you try to use different tools to access one SQLite3 file at the same time this is the same as put 2 separate instance of (for example) MS SQL to look on the one mdf file.
Last edited by mpv (2013-06-04 15:29:56)
Offline
If you really need to access the db file from other processes (in read-only mode, e.g. only for query) in sync with mORMot process, you can set sqlite3 file in WAL mode.
Offline
Pages: 1