[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gb.db2 Connection problem & Fix
[Thread Prev] | [Thread Next]
- Subject: gb.db2 Connection problem & Fix
- From: Denis Crowther <denisc@xxxxxxxxxxxxxx>
- Reply-to: denisc@xxxxxxxxxxxxxx
- Date: Thu, 19 Nov 2026 18:31:51 +1100
- To: mailing list for gambas users <user@xxxxxxxxxxxxxxxxxxxxxx>
courtesy of ChatGPT. ----------Connection.Timeout is ignored by gb.db2.sqlite3 in 3.20.4. The same code path is present in 3.22.0. With Connection.Timeout = -1 set before Open(), a locked write still retries for about 120 seconds because the driver's timeout stays at 0.
In gambas-3.22.0/main/comp/gb.db2/.src/Connection.class, add the middle line in Open()
_Driver = hDriver hDriver.Timeout = Me.Timeout '<--- add $pHandle = hDriver.Open(Me) and add this setter so changes also take effect on an open connection: Private Sub Timeout_Write(Value As Integer) $iTimeout = Value If $pHandle And If _Driver Then _Driver.Timeout = Value End ----------Found by testing a program write with the db being locked by a cli "sqlite> BEGIN IMMEDIATE;"
I wanted an immediate error, never happened.nb: I have a working temp fix but I haven't tested this Gambas level fix yet.
-- Regards Denis
| Re: gb.db2 Connection problem & Fix | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |