Index: gwlib/dbpool.h =================================================================== RCS file: /home/cvs/gateway/gwlib/dbpool.h,v retrieving revision 1.15 diff -u -r1.15 dbpool.h --- gwlib/dbpool.h 9 Jan 2008 20:06:55 -0000 1.15 +++ gwlib/dbpool.h 7 Nov 2008 03:00:31 -0000 @@ -117,10 +117,12 @@ typedef struct { Octstr *file; + int lock_timeout; } SQLiteConf; typedef struct { Octstr *file; + int lock_timeout; } SQLite3Conf; typedef struct { Index: gwlib/dbpool_sqlite.c =================================================================== RCS file: /home/cvs/gateway/gwlib/dbpool_sqlite.c,v retrieving revision 1.7 diff -u -r1.7 dbpool_sqlite.c --- gwlib/dbpool_sqlite.c 9 Jan 2008 20:06:56 -0000 1.7 +++ gwlib/dbpool_sqlite.c 7 Nov 2008 03:00:32 -0000 @@ -79,7 +79,10 @@ error(0, "SQLite: %s", errmsg); goto failed; } - + if (conf->lock_timeout > 0) { + info(0, "SQLite: Setting lock timeout to %ld", conf->lock_timeout); + sqlite_busy_timeout(db, conf->lock_timeout); + } info(0, "SQLite: Opened database file `%s'.", octstr_get_cstr(conf->file)); info(0, "SQLite: library version %s.", sqlite_version); Index: gwlib/dbpool_sqlite3.c =================================================================== RCS file: /home/cvs/gateway/gwlib/dbpool_sqlite3.c,v retrieving revision 1.6 diff -u -r1.6 dbpool_sqlite3.c --- gwlib/dbpool_sqlite3.c 27 Jul 2008 02:29:07 -0000 1.6 +++ gwlib/dbpool_sqlite3.c 7 Nov 2008 03:00:32 -0000 @@ -79,6 +79,10 @@ sqlite3_close(db); goto failed; } + if (conf->lock_timeout > 0) { + info(0, "SQLite3: Setting lock timeout to %ld", conf->lock_timeout); + sqlite3_busy_timeout(db, conf->lock_timeout); + } info(0, "SQLite3: Opened or created database file `%s'.", octstr_get_cstr(conf->file)); info(0, "SQLite3: library version %s.", sqlite3_version); Index: gwlib/cfg.def =================================================================== RCS file: /home/cvs/gateway/gwlib/cfg.def,v retrieving revision 1.134 diff -u -r1.134 cfg.def --- gwlib/cfg.def 26 Jul 2008 09:21:17 -0000 1.134 +++ gwlib/cfg.def 7 Nov 2008 03:00:33 -0000 @@ -548,10 +548,18 @@ ) +MULTI_GROUP(sqlite-connection, + OCTSTR(id) + OCTSTR(database) + OCTSTR(max-connections) + OCTSTR(lock-timeout) +) + MULTI_GROUP(sqlite3-connection, OCTSTR(id) OCTSTR(database) OCTSTR(max-connections) + OCTSTR(lock-timeout) )