Re: [PATCH] Sqlite DB Pool
Alejandro Guerrieri <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Ups, > 0 would be better right?
Changed the datatype to int because that's what the
sqlite_busy_timeout() expects.
[Too little coffee that night] ;)
Fixed on the code plese re-download.
One last note: the value must be properly initialized, otherwise the
struct default could be anything. I've checked the Kannel code and
since there's no dlr_sqlite.c nor any other use for this (yet), no
further patching is necessary.
Regards,
Alejandro Guerrieri
El 07/11/2008, a las 01:57 p.m., Alexander Malysh escribió:
> Hi,
>
> hmm, are you sure ? ;)
>
> + if (conf->lock_timeout != NULL) {
>
> but lock_timeout defined as long...
>
> Thanks,
> Alex
>
> Alejandro Guerrieri schrieb:
>> Hi,
>> I've made this small patch that fixes a couple of things on the
>> Sqlite implementation:
>> * Sqlite2's [sqlite-connection] group was missing from cfg.def,
>> though dbpool_sqlite.c and all the hooks were in place. This patch
>> adds the missing section.
>> * This patch adds a "lock-timeout" configuration option to both
>> sqlite connection groups, where a value in milliseconds can be
>> specified. That value controls the time sqlite waits before
>> throwing a lock ("busy") error. This could be an issue because
>> sqlite locks at the database level (yuk!), and this can surely be a
>> problem under moderate load (I wouldn't recommend sqlite for heavy
>> traffic at all). If not set the default behaviour is maintained, so
>> nothing's broken ;)
>> Please check the post here:
>> http://www.blogalex.com/archives/50
>> Direct download:
>> http://www.blogalex.com/wp-content/uploads/2008/11/kannel-sqlite-pool-patches.diff
>> BTW, my long-term goal is to have on Sqlbox the same DB
>> capabilities as Kannel have (Sqlbox only supports MySql and
>> Postgres and _maybe_ MS SQL). I'm making good progress with sqlite
>> so far, and this patches aim to complete the Kannel support to make
>> it practical to use the DB pool with Sqlbox.
>> MS SQL by Ct-Lib is supposed to be working, though is not supported
>> at Kannel afaik (I'll try to port the code to Kannel so it can be
>> linked from gwlib as the rest does when I have some spare time).
>> Regards,
>> Alejandro Guerrieri
>
>