[yunqa.de] How to correctly avoid 'database is locked' in multi user environment

  • From: H M <docshotmail2@xxxxxxxxxxx>
  • To: DISQLite3 mailing list <yunqa@xxxxxxxxxxxxx>
  • Date: Wed, 9 Jan 2013 19:06:35 +0000

Hi,
I've just come back from doing a presentation/workshop to twenty Department 
Heads on my new application.
It was running from local hard drives but communicating with a single sqlite  
database over a network.

The first thing they had to do was create a password which was then written 
into a password table in the database.
As I slightly expected, I got a 'database is locked' error when two people both 
pressed 'Save' at nearly the same time.

I resolved this at the time by telling them to press 'save' again but what is 
the correct way to do this?

Can somebody (Ralf?) please help me out with the code that will keep trying to 
do a save until the database is unlocked again and ready to accept the write - 
perhaps using sqlite3_busy_timeout - or something?

I'm using DISqlite3 and Delphi 2009

Howard



   
                                          

Other related posts: