Transaction trouble
Posted: Mon 13 Apr 2020 03:21
I must be doing something wrong, getting SQL error:
cncMail := TIBCConnection.Create(nil);
cncMail.Server := gIBServer;
--- server stuff here ---
trnMail := TIBCTransaction.Create(nil);
trnMail.DefaultConnection := cncMail;
trnMail.Params.Clear;
trnMail.Params.Add('WRITE');
trnMail.Params.Add('WAIT');
trnMail.Params.Add('READ_COMMITTED');
qryMail := TIBCQuery.Create(nil);
qryMail.Connection := cncMail;
qryMail.LockMode := lmLockImmediate;
qryMail.Transaction := trnMail;
cncMail.Connect;
then later when I have 3 threads running and they are all trying to do like this:
Executing query <UPDATE EMAIL SET LOCKID = '00000003' WHERE LOCKID = '00000000' AND SENT = FALSE ROWS 1>
MailTask: SQL Error: lock conflict on no wait transaction
why is it saying nowait ? I said WAIT in the params. What am I doing wrong ? Also, "READ COMMITTED" is flagged as error, but that is what Interbase API says, you're using different terms.
cncMail := TIBCConnection.Create(nil);
cncMail.Server := gIBServer;
--- server stuff here ---
trnMail := TIBCTransaction.Create(nil);
trnMail.DefaultConnection := cncMail;
trnMail.Params.Clear;
trnMail.Params.Add('WRITE');
trnMail.Params.Add('WAIT');
trnMail.Params.Add('READ_COMMITTED');
qryMail := TIBCQuery.Create(nil);
qryMail.Connection := cncMail;
qryMail.LockMode := lmLockImmediate;
qryMail.Transaction := trnMail;
cncMail.Connect;
then later when I have 3 threads running and they are all trying to do like this:
Executing query <UPDATE EMAIL SET LOCKID = '00000003' WHERE LOCKID = '00000000' AND SENT = FALSE ROWS 1>
MailTask: SQL Error: lock conflict on no wait transaction
why is it saying nowait ? I said WAIT in the params. What am I doing wrong ? Also, "READ COMMITTED" is flagged as error, but that is what Interbase API says, you're using different terms.