On 24 Apr 2013, at 11:58am, "J Trahair" <j.trah...@foreversoftware.co.uk> wrote:

> I had closed the connection after the COMMIT, but it works great if I don't.

Your problem is not with closing the connection but with the COMMIT.  The BEGIN 
goes with the COMMIT.  When you go 'BEGIN EXCLUSIVE' you do have your exclusive 
lock, but only until you have finished that transaction.  And 'COMMIT' is one 
way to finish a transaction, so the 'COMMIT' releases the lock.  So your 
procedure for locking a database for a quarter second is

BEGIN EXCLUSIVE
    do anything you want here for a quarter second
COMMIT

You should definitely do the COMMIT eventually, of course.  UNLESS you want to 
cancel the transaction.  But closing the connection plays no part in this.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to