Cory Bennett wrote:
> Hello all,
> 
> I have started using soci on a new project and found I needed to call
> sqlite3_busy_timeout on the sqlite3 database handle to avoid the 
> frequent "database is locked" errors.

Cory,

Understood. Good catch.

> Currently the sqlite3 backend for soci does not allow for this, so I 
> have attached a patch. The patch is generated from a diff against cvs
> HEAD.

OK. However, you've known that SOCI moved to GIT repo, have you?

$ git clone git://soci.git.sourceforge.net/gitroot/soci

with Web access here:

http://soci.git.sourceforge.net/

> The usage backwards compatible, so the old usage still works:
> 
> soci::session(soci::sqlite3, "/tmp/foo.db");
> 
> With the patch you can specify a timeout, using syntax similar to the
> mysql backend:
> 
> soci::session(soci::sqlite3, "dbname=/tmp/foo.db timeout=10");
> 
> the timeout value is in seconds, which will cause the database handle
> to wait up to the specified time trying to get a database lock when 
> normally it would have thrown the "database is locked" error 
> immediately.

OK.

> Please review the patch and apply if you find it reasonable.  If you 
> have questions or comments please let me know.

Your patch has been submitted to the master branch in SOCI git
repository:

<http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci;a=commit;h=2d8c87c0b7a2ab6a25a869253ee2acfc994f0418>

Thank you very much for the patch!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to