Hi,

 

I'm running a multi-threaded application and am running into some
concurrency issues.  I have thread "A" which is attempting to do
thousands of reads that take approximately 20-50ms each.  Thread "B" is
writing to the database and each write takes a few seconds.  Currently,
it appears that thread "A" is locked out from reading while thread "B"
is writing (which is what I expect based upon documentation).  Thread
"B" is working within transactions so thread "A" is only locked out
while thread "B" is committing.  So essentially thread "A" is taking 60x
longer to execute when thread "B" is writing.  I've tried enabling the
shared cache, but that results in lots of database lock failures and
seems to ignore the busytimeout.  Does anybody have any creative
solutions to such a problem?

 

I've looked in to the read_uncommitted pragma command, but can't find a
lot of detail.  In the code documentation, it says that the
read_uncommited pragma ignores the "table" lock, but my understanding of
the locking model is that the database as a whole is locked, not
individual tables.  Also, the documentation seemed to indicate that it
had some relationship to the shared cache mode.  Would enabling the
read_uncommited pragma ever result in invalid data being read from a
table which is being written to?

 

Thank for any help!

 

Mike Borland

CygNet Software, Inc.

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

Reply via email to