On 7 Sep 2014, at 3:22am, Richard Warburton <rich...@skagerraksoftware.com> 
wrote:

> Should transactions be used for ensuring consistency between multiple
> queries?

Good idea.

> And if so, after I've finished is there a reason why I should not
> call commit?

You should finish the transaction some way.  I can see why ROLLBACK would 
appeal as a guard against accidental writing, but it's not neat.  COMMIT is 
neater.

A bunch of my web pages need to look up a bunch of things to fill in details on 
the page.  Your idea would make sure that everything was definitely consistent, 
even if it was outdated almost immediately the page was finished being drawn.

I see no reason why you shouldn't do it but you should test to find out what 
happens if someone closes the page before it is finished drawing.  If your code 
is PHP the database will be unlocked because PHP would hold a separate 
connection for each page.  But if your code is JavaScript the lock might 
persist, and you may have to learn how to release it.

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

Reply via email to