Hi,

We are newbie to SQLite and we would like to lock a table through a select +
update.

Something like that:

BEGIN TRANSACTION

   currentValue = select currentValue from sequence_transactions;

   update sequence_transactions set currentValue = currentValue + 1;

   COMMIT;

END TRANSACTION

When the program reachs the select, we would like other threads /
applications wait for that transaction to finish.

Is there any way of achiving that?


Read through the documentation on locking. It should do what you want
and explain
it so you can understand it. I think what you already have written will probably
work fine, but as always, the difficulty is in the details.

http://sqlite.org/lockingv3.html



--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to