Hi all,

I'm using the mozStorage implementation from Mozilla foundation, with 
Javascript and XUL (for the UI) to build a business-type app.

I'm having this problem where I seem to get a lock of about 10 seconds 
after a read operation on a table, before I can perform a write 
operation on the same table.

This is what I'm trying to do. When user clicks the 'OK' button on a 
particular form, I run a 'SELECT' query on the invoice table to check if 
the invoice number on the form is already in use. Then, if it is not in 
use, I attempt to save the input from the form in the invoices table. 
However, this silently fails. If I assign (for testing purposes) the 
first part of the code for checking the invoice number to a different 
button, I am able to perform that operation, and if I wait about 10 
seconds, I can press the other button and save the record. Any shorter 
period of time, it refuses to save the invoice data into the table.

The SQLite documentation talks about entire database locks by operations 
of the order of milliseconds - 10 seconds seems a long way off. Does 
anybody have any ideas on this? Has anybody used the mozStorage 
interface - and is it to blame for the delay? I have tried finalizing 
the statements, and closing the connection after each SQL statement, or 
leaving the connection to the database open - doesn't make any 
difference. I have tried using a transaction around the first operation, 
with each transaction type in turns, to try and get it out of the way 
quicker and release the lock - still no difference. The database is 
small - about 10 tables, with only a few testing records in each. It is 
not shared by any other app and it is on the local hard-disk. The 
computer is relatively fast and responsive - no other speed issues. 
Actually, aside from this, everything works very nice - even complex 
'SELECT' statements with aggregate functions pulling data from three 
different tables work instantly. Oh, and SQL update statements where 
there is no immediate prior operation on same table are fast.

The setup is:

OS: Slackware Linux 12.2
Kernel: 2.6.27.7
CPU: Intel Core 2 Duo ULV 2500 (1.2GHz)
RAM: 2GB
XULRunner: 1.9.0.7
SQLite: 3.6.6.2


Many thanks for any suggestions or ideas.


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

Reply via email to