You are not logged in.
Pages: 1
Hi Arnaud,
You said that the synopsis sqlite engine is not compiled to be thread-safe, can I recompile it to be thread-safe?
You know, there are chances we need to access the database using other ways, for example, to access the DB from programs written in other language. In my specific case, I'll write some part of the app in Python, the only reason is that, that part will be cross-platform ready.
Thanks and have a nice day!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
I think you already asked this question in this forum:
http://synopse.info/forum/viewtopic.php?id=287
The answer didn't change!
(yet)
Because of the ORM layout, you should only use RESTful access, not direct access to the DB.
For instance, we need to have the cache updated.
So you would have to use RESTful access from Python.
Not difficult, since you can just use HTTP/1.1 and JSON natively in the Python library.
Offline
Hi Arnaud,
Well, I understand, but in my specific case, the server will read data only and the client will write data only, so directly accessing to the DB is ok, and I want things to be simplified. Does your answer means that there is no way to re-compile the engine to be thread-safe?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
If you open the DB file from another process, it will still be able to access.
The current engine is compiled with define SQLITE_THREADSAFE = 2, that is assuming multi-thread safety is made by the caller.
But it's still process-safe, that is you will be able to safely access from another process.
So if your python library is able to handle the same file format as our ORM, I don't see any problem.
There will still be a file-level locking for writing.
Offline
Pages: 1