Package: libsqliteodbc
Version: 0.992-2
Severity: normal
Hello,
thanks for maintaining sqliteodbc.
I have an application that may connect/disconnect many time to sqlite3
files during its lifetime, and I found that after some time it was
hitting the maximum number of open files.
After a lot of debugging, I found out that sqlite_close was failing with
SQLITE_BUSY in drvdisconnect, but its return code was being ignored.
It took a day of work to pinpoint what was the prepared statement
preventing sqlite3 to shut down the connection and once I found it I
could disposed of it properly, fixing the problem in my application.
However, since I do check the return value of SQLDisconnect when I
cleanup my connections, my life would have been much easier if I could
have detected that SQLDisconnect actually failed.
drvdisconnect already returns "incomplete transaction" in some cases:
perhaps it could return it also when sqlite_close returns SQLITE_BUSY?
Here's drvdisconnect for reference:
static SQLRETURN
drvdisconnect(SQLHDBC dbc)
{
DBC *d;
if (dbc == SQL_NULL_HDBC) {
return SQL_INVALID_HANDLE;
}
d = (DBC *) dbc;
if (d->magic != DBC_MAGIC) {
return SQL_INVALID_HANDLE;
}
if (d->intrans) {
setstatd(d, -1, "incomplete transaction", "25000");
return SQL_ERROR;
}
if (d->vm_stmt) {
vm_end(d->vm_stmt);
}
if (d->sqlite) {
sqlite_close(d->sqlite);
d->sqlite = NULL;
}
freep(&d->dbname);
freep(&d->dsn);
return SQL_SUCCESS;
}
Ciao,
Enrico
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libsqliteodbc depends on:
ii libc6 2.17-3
ii libsqlite0 2.8.17-7
ii libsqlite3-0 3.7.17-1
ii multiarch-support 2.17-3
libsqliteodbc recommends no packages.
Versions of packages libsqliteodbc suggests:
ii unixodbc-bin 2.3.0-3
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]