apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject SQLite3 BUSY return status
Date Mon, 17 Apr 2006 04:51:39 GMT
In this part of the code of the SQLite3 driver (function
dbd_sqlite3_select):

-----------------------------------------
if (ret == SQLITE_BUSY) {
    if (retry_count++ > MAX_RETRY_COUNT) {
        ret = SQLITE_ERROR;
} else {
    apr_dbd_mutex_unlock();
    apr_sleep(MAX_RETRY_SLEEP);
    apr_dbd_mutex_lock();
}
-----------------------------------------

We are returning SQLITE_ERROR when maximum number of retries has been
exhausted. However, the caller may want to know that there was no error,
but a timeout instead, therefore potentially retrying the operation from
the calling code (in fact, for high concurrency of requests, SQLITE3 is
very likely to give us this kind of behaviour). Maybe we should return
APR_TIMEUP or APR_EBUSY instead?

PS. I think returning native SQLITE3 or other database codes isn't very
useful anyway - the caller most likely won't have access to code
meanings (i.e. headers files) of native databases. I think we should be
returning APR error codes throughout DBD.

-- 
Bojan


Mime
View raw message