This project is archived and is in readonly mode.
SQLite3::BusyExceptions are raised immediately in some cases, despite setting sqlite3_busy_timeout()
-
Edzard Pasma
Another solution may be found in the Python Sqlite interface. Python defines a common interface to all databases (DBAPI2) that specifies that database connections are by default NOT in autocommit mode. This may be different from Ruby (I'm completely ignorant here) but possibly the Python solution for SQLite brings a new idea. The Python interface needs to turn off the autocommit mode which is achieved by a simple BEGIN statement. But this is not issued rigth away but only when the first UPDATE (or other dml) statement is encountered. The interface scans each SQL statement to determine this. This way the RESERVED lock will be acquired when the connection does not yet have a SHARED lock and then the busy timeout will be neatly observed. The idea for Ruby would be to do something similar within the ActiveRecord transaction method (only for SQLite).
Excuse me if this is not to the point. Also note that the idea is of no use if a connection already has a shared lock (by some unfinished cursor) before the transaction is started.
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale