Matthew Veenstra <[EMAIL PROTECTED]> wrote:
  Hello,

I was wondering if someone can shed a bit of light on a problem I am 
having. I am using SQLite in a client setting on Mac and Windows. I 
have two threads. That I use SQLite in. The main thread uses this 
to get data and display it to screen. Then I have a worker or 
secondary thread that batch process many commands with a Transaction 
using BEGIN: and COMMIT:.

As the transaction happens on the second thread the main thread 
continues about it's business and displays information. This seems 
to work just fine...until COMMIT: is called. Once COMMIT is called I 
get database is locked and I am not able to proceed.

I am not a master of SQLite so I am not sure if this is expected 
behavior.

Here are some things I am doing that might be relevant.
- I have many temp tables that are created and can be opened at this 
time.
- I am using my own built frameworks on the Mac and the default ones 
on Windows. I build this framework from the preprocessed Windows 
files. I set these C flags at compile time.
-DTHREADSAFE=1 \
-DSQLITE_THREAD_OVERRIDE_LOCK=-1 \
-DOS_UNIX=1 \
-DHAVE_USLEEP=1 \
-DSQLITE_OMIT_CURSOR

I would expect SQLite to wait for the COMMIT to finish and then be 
able to use the data base just as before.

Am I missing something?

Thx,
Matt
tribalmedia




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

  
Matt, 
   
  this is expected behavior.  I start every read/write operation by wrapping 
them with a begin exclusive and then commit. That way I don't get any of the 
annoying locking issues at commit point. This has a disadvantage that all 
access is now serialized behind sqlites locking mechanism as even select 
operations get exclusive access to the DB.
   
   

Reply via email to