[odb-users] Query Abort Error
Sum, Eric B
eric.b.sum at lmco.com
Thu Mar 14 16:03:54 EDT 2013
Hi,
I am using odb version 2.2.0 with sqlite 3.7.13 in a multi-threaded application. The database uses a connection pool factory with minConnections and maxConnections of 0. Connections in the pool factory have a logging mechanism attached to them so that I can see the sql statements executed in text.
I recently out of the blue ran into the error "4(517): aborted due to ROLLBACK" in the middle of doing a query when running the application. The query has run fine in previous runs and was executing fine in this exact run before this error arose.
This is the first time that I have seen this. Because this problem has came up out of the blue with a query that has been running ok, I think that this is some sort of a race condition.
Based on this link (http://osdir.com/ml/sqlite-users/2012-04/msg00696.html), my guess is that one of the connection's transactions in the factory got rolled back, and this caused the connection doing the query transaction to abort. This is the behavior described in shared_cache mode.
I looked at the logs, and there were definitely lots of ROLLBACK statements around when the query aborted (could not isolate the exact statement). I believe that the rollback statements could be from failed attempts in the unlock_notify mechanism to perform sqlite3_step() calls, but I am not sure.
I have been unable to duplicate this behavior.
1) Is this assessment correct? This is just my guess/interpretation of what's possibly happening.
2) If so, I am guessing that the odb exception thrown is recoverable (I am not sure which one). Therefore, could I simply catch the recoverable exception and retry the query(like in 3.7 of the manual) as a solution to this?
Thanks so much.
Any help is appreciated.
-Eric
More information about the odb-users
mailing list