[cl-sqlite-devel] [patch] timeout support

James Wright jrwright at cs.ubc.ca
Fri Jul 24 01:30:02 UTC 2009


Hi,

I've been using cl-sqlite to dump results from parallel processes into
a sqlite db.  The problem with this is that sometimes two processes
will attempt to write to the file at the same time.  The sqlite
library will retry, but it will only do so if a timeout has been set
on the connection.  I've added timeout/retry support to cl-sqlite, and
I thought it might be useful to others, so I've attached a patch.

I don't have a platform-independent unit test, since I believe it
needs threads to test properly, but I've attached (in
'sqlite-noodling.lisp') a file that reproduces the problem (function
`tst1') and shows that the fix actually fixes it (`tst2').

      James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-support-for-timed-wait-for-locked-databases-a.patch
Type: text/x-diff
Size: 3388 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-sqlite-devel/attachments/20090723/374efc3e/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlite-noodling.lisp
Type: application/octet-stream
Size: 1385 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-sqlite-devel/attachments/20090723/374efc3e/attachment.obj>


More information about the cl-sqlite-devel mailing list