Source: sqlite3
Version: 3.6.23.1-1
Severity: wishlist
Tags: patch

Hi,

SQLite3 has a specific API that can be used in multithreaded programs to wait
for the DB to become available after an operation failed with SQLITE_LOCKED.

It's called the unlock notify API, and is currently disabled in the Debian
builds of sqlite3.

This API is a must-have for multithreaded programs where each thread uses its
own connection to the DB, otherwise they'll keep stepping on each other's toes
with queries "randomly" failing. The unlock notify API is the only way to
properly wait & retry the queries failing with SQLITE_LOCKED.

Enabling this API is a simple matter of defining SQLITE_ENABLE_UNLOCK_NOTIFY
when building the package. It doesn't change the exported ABI, but adds a new
exported function (sqlite3_unlock_notify) so you'll need to bump the version
in the shlibs file or take care of adding the symbol with the proper version
to the symbols file if you use that.

Patch for debian/rules attached, please apply!

Thanks,

JB.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32.2 (SMP w/2 CPU cores)
Locale: LANG=C, lc_ctype=fr...@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages sqlite3 depends on:
ii  libc6                         2.10.2-7   Embedded GNU C Library: Shared lib
ii  libreadline6                  6.1-2      GNU readline and history libraries
ii  libsqlite3-0                  3.6.23.1-1 SQLite 3 shared library

sqlite3 recommends no packages.

Versions of packages sqlite3 suggests:
pn  sqlite3-doc                   <none>     (no description available)

-- no debconf information
--- debian/rules.orig   2010-04-26 16:25:43.000000000 +0200
+++ debian/rules        2010-04-26 15:24:43.000000000 +0200
@@ -57,6 +57,6 @@
 DEB_SHLIBDEPS_INCLUDE_sqlite := debian/libsqlite3-$(so_version)/usr/lib/
 
 #DEB_OPT_FLAG := -O2 -fno-strict-aliasing -DSQLITE_ENABLE_COLUMN_METADATA 
-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_ICU=1
-DEB_OPT_FLAG := -O2 -fno-strict-aliasing -DSQLITE_SECURE_DELETE 
-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE=1 
-DSQLITE_SOUNDEX=1
+DEB_OPT_FLAG := -O2 -fno-strict-aliasing -DSQLITE_SECURE_DELETE 
-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE=1 
-DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY
 
 DEB_DH_STRIP_ARGS := --dbg-package=libsqlite3-$(so_version)-dbg

Reply via email to