You are not logged in.
Arnaud,
I've noticed many times there are .sqlitedb-wal and .sqlitedb-shm leftover files. I use TSQLRestClientDB, I do have WAL enabled, with the intention of getting maximum stability; I do have have multiple threads starting/commiting transactions.
Any help would be appreciated!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
additional info, My derived TransactionBegin() is protected with a TOmniMREW (mulit-reader-exclusive-writer) lock, like this:
function TDataStoreClient.TransactionBegin(aTable: TSQLRecordClass; SessionID:
cardinal): boolean;
begin
//if the db server is in the same process, we protect the writing operation from
//being executed by multi threads.
if IsServerInSameProcess then
gAppScopeDbLock.EnterWriteLock; //this is an global lock
result := inherited TransactionBegin(aTable, SessionID);
end;
procedure TDataStoreClient.Commit(SessionID: cardinal);
begin
try
inherited Commit(SessionID);
finally
if IsServerInSameProcess then
gAppScopeDbLock.ExitWriteLock;
end;
end;
Any logical problems in my derived TSQLRestClientDB class?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
We recommend not to use TransactionBegin from client sides, but a BATCH with a positive argument to BatchStart() for automatic transaction on the server side.
You should not need to do anything special on the client side for transaction protection.
It is already part of the TSQLRestServer.URI method, AFAIR.
Offline
Arnaud,
as per this discussion http://synopse.info/forum/viewtopic.php?id=1905
the URI methods doesn't return the actual database error, which we need.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Arnaud, this is not a real client/server app, but a single EXE USING TSQLRestClientDB, so it really need to handle the actual sqlite server. Do you think if I switch to TSQLRestServerDB will fix the problem?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline