Subject Re: [IBO] IBO 4.9.8 - TIB_Cursor bug with pessimistic lock?
Author Jason Wharton
I wrote a quick test in Delphi 2010 with the latest IBO 4.9.8 and it works
flawlessly.

Here is the code:

IB_Cursor1.SQL.Text := 'select * from fts$_IND for update';
IB_Cursor1.PessimisticLocking := true;
IB_Cursor1.First;
IB_Cursor1.Edit;
IB_Cursor1.Cancel;


Here is the SQL Monitor trace:

/*---

CLOSE CURSOR

STMT_HANDLE = 2

----*/

/*---

PREPARE STATEMENT

TR_HANDLE = 4

STMT_HANDLE = 2

select * from fts$_IND for update

PLAN (FTS$_IND NATURAL)

FIELDS = [ Version 1 SQLd 21 SQLn 30

FTS$_IND.FTS$IND_NME = <NIL>

FTS$_IND.FTS$TBL_NME = <NIL>

FTS$_IND.FTS$KEY_COL = <NIL>

FTS$_IND.FTS$AUX_COL = <NIL>

FTS$_IND.FTS$SCH_COL = <NIL>

FTS$_IND.FTS$SCH_LEN = <NIL>

FTS$_IND.FTS$WRD_LEN = <NIL>

FTS$_IND.FTS$USR_LEN = <NIL>

FTS$_IND.FTS$MIN_LEN = <NIL>

FTS$_IND.FTS$KEY_DM = <NIL>

FTS$_IND.FTS$KEY_TYP = <NIL>

FTS$_IND.FTS$KEY_IND = <NIL>

FTS$_IND.FTS$WDS_TYP = <NIL>

FTS$_IND.FTS$STATUS = <NIL>

FTS$_IND.FTS$LOG = <NIL>

FTS$_IND.FTS$SOUNDEX = <NIL>

FTS$_IND.FTS$SNDXMAX = <NIL>

FTS$_IND.FTS$METAPHN = <NIL>

FTS$_IND.FTS$SYNONYM = <NIL>

FTS$_IND.FTS$ANTONYM = <NIL>

FTS$_IND.FTS$COND_EXPR = <NIL> ]

SECONDS = 0.016

----*/

/*---

STATEMENT INFO

STMT_HANDLE = 2

----*/

/*---

EXECUTE STATEMENT

TR_HANDLE = 4

STMT_HANDLE = 2

PARAMS = [ ]

----*/

/*---

OPEN CURSOR

STMT_HANDLE = 2

NAME = C166552644680354



SECONDS = 0.016

----*/

/*---

PREPARE STATEMENT

TR_HANDLE = 4

STMT_HANDLE = 5

UPDATE FTS$_IND FTS$_IND SET FTS$_IND.FTS$IND_NME = FTS$_IND.FTS$IND_NME

WHERE CURRENT OF C166552644680354

PLAN (FTS$_IND INDEX ())

FIELDS = [ Version 1 SQLd 0 SQLn 30 ]

----*/

/*---

STATEMENT INFO

STMT_HANDLE = 5

----*/

/*---

EXECUTE STATEMENT

TR_HANDLE = 4

STMT_HANDLE = 5

PARAMS = [ ]

SELECT COUNT: 1

UPDATE COUNT: 1

----*/

/*---

ROLLBACK RETAINING

TR_HANDLE = 4

----*/



----- Original Message -----
From: "Enrico Raviglione" <e.raviglione@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, January 07, 2010 9:19 AM
Subject: [IBO] IBO 4.9.8 - TIB_Cursor bug with pessimistic lock?


Sorry for my previous dirty email...



Hi Jason,

please verify TIB_Cursor with pessimistic lock because when i call Edit()
application hang with an exception.

TIB_Cursor SemaforoC SQL: Select KEYTABLE1, USER From SEMAFORO;

Code :

SefamoroC.Prepare();

SemaforoC.First();

SemaforoC.Edit(); รง Here application does an exception


The same code work properly if i using a TIBOQuery instead of TIB_Cursor.

Best regards,

Enrico Raviglione.