Setting sqlite3_busy_timeout throught ZeosLib

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
GeorgeBaker
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 12.11.2010, 10:18

Setting sqlite3_busy_timeout throught ZeosLib

Post by GeorgeBaker »

Hello all,

is there a way how I can set sqlite3_busy_timeout (db:busy_timeout, or just busy_timeout) through ZeosLib (or not) in Lazarus? Problem is that my project is using multiple connections to SQLite database file and it sometimes suffer from "Database is locked" exception.

Thanks in advance for help.
hakaneri
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 17.08.2011, 14:09

Post by hakaneri »

Hello,
I have the same question as George. Is there a way to set busy_timeout for for sqlite via Zeoslib ? If not is there a plan for including this into 7.0 ?

Thanks,
Håkan
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

This function is already implement, even though is not simple to use.

Anyway add ZPlainSqliteDriver to the uses units.

An example:

var
FPlainDriver: IZSQLitePlainDriver;
begin
FPlainDriver := ZConnection1.DbcConnection.GetIZPlainDriver as IZSQLitePlainDriver;
FPlainDriver.BusyTimeout(ZConnection1,3000);
...

Hope this can help you
johank
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 24.08.2011, 13:10

Post by johank »

I just posted a simple fix for this here http://zeos.firmos.at/viewtopic.php?t=2853
Post Reply