Subject Re: TIB_Cursor.RequestLive forces Explicit Record Lock on FB1.5
Author Hugo
Jason, don't worry about it.
I have installed Firebird 1.5 RC3 and the 'deadlock exception' is
dissapeared !!
At WhatsNew.txt I read:
* Fixed RC2 bug.
Various issues with the lock manager.
Contributor(s):
Nickolay Samofatov

By the way, before the RC3, I could workaround the deadlock with the
following sequence:

IB_Connection1.Connect;
IB_Cursor1.Prepare;
IB_Cursor1.First;
IB_Cursor1.Close;
IB_Cursor1.Unprepare; <----- this avoids the exception
IB_DSQL1.Prepare;
IB_DSQL1.Execute;

Greetings,
Hugo.

----- Original Message -----
From: "Hugo" <hugosan@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, May 19, 2003 1:51 AM
Subject: [IBO] TIB_Cursor.RequestLive forces Explicit Record Lock on FB1.5
(RC1)?

> I have post this question one month ago, but I get no reply, so I retry
> because it's critical for me...
>
> (IBO 4.2.Hi)
> I don't know if this is a IBO-related issue, but I expose here to find
out:
>
> I have a simple project with:
> - one TIB_Connection, IB_Connection1
> - one TIB_Cursor, IB_Cursor1, linked to IB_Connection1
> - one TIB_DSQL, IB_DSQL1, linked to IB_Connection1
> - no TIB_Transactions are present
>
> Metadata:
> CREATE TABLE MYTABLE (
> MY_PK CHAR(2) NOT NULL PRIMARY KEY,
> MACHINE SMALLINT);
>
> The only record on table:
> INSERT INTO MYTABLE VALUES('AA', 1);
>
> IB_Cursor1.SQL :
> SELECT MY_PK
> , MACHINE
> FROM MYTABLE
> WHERE MY_PK='AA';
> IB_Cursor1.RequestLive := true (because maybe I'd need delete or insert
> record)
>
> IB_DSQL1.SQL :
> DELETE
> FROM MYTABLE
> WHERE MACHINE=1;
>
> The sequence I make:
>
> IB_Connection1.Connect;
> IB_Cursor1.Prepare;
> IB_Cursor1.First; /* now it's pointing to the only record 'AA',1 */
> IB_Cursor1.Close;
> IB_DSQL1.Prepare;
> IB_DSQL1.Execute; /* raises an exception 'lock conflict on no wait
> transaction' 'deadlock' 'update conflicts with concurrent update' */
>
> The same sample on Firebird 1.0 doesn't raise the 'deadlock' exception.
> The same sample on FB 1.5 (RC1) with IB_Cursor1.RequestLive := false
doesn't
> raise the 'deadlock' exception.
>
> It's to say, it seems like the 'FOR UPDATE' clause on TIB_Cursor
> (RequestLive:=true) includes also the explicit record lock feature added
by
> Nickolay Samofatov to FB1.5 . But this feature, based on posts I read on
> Firebird-devel list, requires the syntax 'FOR UPDATE WITH LOCK' . So,
> initially I put my suspicion on IBO parser; after I search full text on
IBO
> sources, I don't find the string 'WITH LOCK' nowhere... Moreover, this
> feature (explicit record lock) it's not related to FB config file
> (firebird.conf) , and it's not the default behaviour for the engine.
> I know FB1.5 RC1 it's not a official release; but I have this
> "error/trouble"since FB1.5Alpha5 and I've waited until Release Candidate,
> more definitive.
> I just want to know if I can discard it as an IBO problem, and expose it
to
> firebird-devel list.
>
> Many thanks in advance,
> Hugo.