In my app that embeds sqlite version 3.7.14, I'm running into a database 
locking problem that happens when detaching a database.  If I execute

attach database 'file:dbtest.db?mode=ro' as prism

the attachment happens okay, but when I execute

detach database prism

I get the error 'database prism is locked'

I assumed that this is a duplicate of the question at

http://goo.gl/k3raLi
http://stackoverflow.com/questions/15531498/sqlite-why-cant-i-detach-a-database-when-the-main-db-has-an-open-statement

but I'm having trouble finding the statement in question... I'm tracking all my 
calls to sqlite3_prepare_v2() and sqlite3_finalize() and it seems like the all 
prepared statements are being finalized.  I'm not using any explicit 
transactions or sqlite3_blobs, and the app is single threaded.

I looked through the transaction page at 
http://www.sqlite.org/lang_transaction.html and didn't see anything obvious 
that I'm tripping on.

Is there some way to find out what is causing the lock?  I've looked through 
the C interface documentation and didn't notice anything promising.  If I could 
find the statement that's causing the lock that would be most helpful, if 
that's the problem.  Or maybe there's something else it could be?  Any 
suggestions would be welcome.

Thanks

Erik

----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may 
contain information that is privileged, confidential and/or proprietary and 
subject to important terms and conditions available at 
http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended 
recipient, please delete this message.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to