Subject Re: [IBO] lock conflict on no wait transaction ...?
Author jwharton@ibobjects.com
In short, design your application in such a way that you don't update the same record in different transactions both open
simultaneously.

This is actually a very involved subject and it depends greatly on many factors specific to your requirements, something
we know very little about as yet.

Regards,
Jason Wharton
www.ibobjects.com

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hi everyone...

How to solve this problem?

-------------------------

ISC ERROR CODE:335544345
lock conflict on no wait transaction deadlock update conflicts whit concurrent update

STATMENT:
TIB_Statement:
"<TApplication>.dmq.Qconta.IBOqrconta.<TIB_UpdateSQL>.<TIB_Statment>."

STATEMENT:

-----------------------------------

More about what Im using:

D7 >> IBO 4.2.Ie >> Firebird 1.5 Final
Dataset compatible components (TIBODATASET)

Below TIBOquery have its IB_Transaction property=dmtran.tranQdocumento

dmq.Qdocumento
dmq.Qdocumentoitem
dmq.Qreceitadespesa
dmq.Qreceitadespesaitem
dmq.Qmovimento
dmq.Qconta

except dmq.Qpegavalorconta >> IB_Transaction property=dmtran.tranQpegavalorconta

Some properties of tranQdocumento (TIBOTransaction) and dmtran.tranQpegavalorconta (TIBOTransaction)
AutoCommit=True
Isolation=tiCommitted
LockWait=False
ServerAutoCommit=False

-----------------------
Code:

dmtran.tranQdocumento.StartTransaction;
try
dmq.Qdocumento.post;
for linha:=0 to stringgrid2.Rowcount -1 do
begin
if not dmq.SPdocumentoitem.Prepared then
dmq.SPdocumentoitem.Prepare;
dmq.SPdocumentoitem.ExecProc;

dmq.Qdocumentoitem.ParamByName('codigo').AsString:=dmq.SPdocumentoitem.ParamByName('ID').AsString;
dmq.Qdocumentoitem.ParamByName('codproduto').AsString:=stringgrid2.Cells[0,linha];
dmq.Qdocumentoitem.ParamByName('coddocumento').AsString:=dmq.QdocumentoCODIGO.AsString;
dmq.Qdocumentoitem.ParamByName('quantidade').AsString:=stringgrid2.Cells[3,linha];
dmq.Qdocumentoitem.ParamByName('valor').AsString:=stringgrid2.Cells[4,linha];
dmq.Qdocumentoitem.ParamByName('numero').AsString:=stringgrid2.Cells[2,linha];
dmq.Qdocumentoitem.ParamByName('subtotal').AsString:=removeponto(stringgrid2.Cells[5,linha]);
dmq.Qdocumentoitem.ParamByName('obs').AsString:=stringgrid2.Cells[6,linha];
dmq.Qdocumentoitem.ParamByName('codcategoria').AsString:=removeponto(stringgrid2.Cells[9,linha]);
dmq.Qdocumentoitem.ParamByName('ano').AsString:=stringgrid2.Cells[8,linha];
if not dmq.Qdocumentoitem.Prepared then
dmq.Qdocumentoitem.Prepare;
dmq.Qdocumentoitem.ExecSQL;
end;
lanca_receitaDespesa_receitadespesaitem_movimento_conta; //call to procedure
dmq.Qreceitadespesa.ExecSQL;
dmq.Qreceitadespesaitem.ExecSQL;
dmq.Qmovimento.ExecSQL;
dmtran.tranQdocumento.Commit;
except
on E: Exception do
begin
dmtran.tranQdocumento.Rollback;
showmessage(E.Message);
end;
end;


procedure Tndocumento.lanca_receitaDespesa_receitadespesaitem_movimento_conta;
begin
if not dmq.SPreceitadespesa.Prepared then
dmq.SPreceitadespesa.Prepare;
dmq.SPreceitadespesa.ExecProc;
if not dmq.SPidreceita.Prepared then
dmq.SPidreceita.Prepare;
dmq.SPidreceita.ExecProc;
dmq.Qreceitadespesa.ParamByName('CODIGO').AsString:=dmq.SPreceitadespesa.ParamByName('ID').AsString;
dmq.Qreceitadespesa.ParamByName('DATA').AsString:=nprincipal.datahora;
dmq.Qreceitadespesa.ParamByName('CODTITULAR').AsString:=dmc.QdblookuptitularconsultaCODIGO.AsString;
dmq.Qreceitadespesa.ParamByName('CODTIPODEBITOCREDITO').AsString:='1';
dmq.Qreceitadespesa.ParamByName('TIPO').AsString:='C';
dmq.Qreceitadespesa.ParamByName('TOTAL').AsString:=dmq.QdocumentoTOTAL.AsString;

dmq.Qreceitadespesa.ParamByName('IDRECEITADESPESA').AsString:=dmq.SPidreceita.ParamByName('ID').AsString;
if (radiogroup1.ItemIndex=0) or (radiogroup1.ItemIndex=1) then //gera o id do recibo
begin
if not dmq.SPidrecibo.Prepared then
dmq.SPidrecibo.Prepare;
dmq.SPidrecibo.ExecProc;
dmq.Qreceitadespesa.ParamByName('IDRECIBO').AsString:=dmq.SPidrecibo.ParamByName('ID').AsString;
end
else
dmq.Qreceitadespesa.ParamByName('IDRECIBO').AsVariant:=null;
if not dmq.SPreceitadespesaitem.Prepared then
dmq.SPreceitadespesaitem.Prepare;
dmq.SPreceitadespesaitem.ExecProc;

dmq.Qreceitadespesaitem.ParamByName('CODIGO').AsString:=dmq.SPreceitadespesaitem.ParamByName('ID').AsString;

dmq.Qreceitadespesaitem.ParamByName('CODRECEITADESPESA').AsString:=dmq.Qreceitadespesa.ParamByName('C
ODIGO').AsString;
dmq.Qreceitadespesaitem.ParamByName('CODDOCUMENTO').AsString:=dmq.QdocumentoCODIGO.AsString;

if not dmq.SPmovimento.Prepared then
dmq.SPmovimento.Prepare;
dmq.SPmovimento.ExecProc;
dmq.Qmovimento.ParamByName('CODIGO').AsString:=dmq.SPmovimento.ParamByName('ID').AsString;
dmq.Qmovimento.ParamByName('VALOR').AsString:=dmq.QdocumentoTOTAL.AsString;
dmq.Qpegavalorconta.Close;
dmq.Qpegavalorconta.ParamByName('pcodigo').AsString:=dmq.QcontaCODIGO.AsString;
dmq.Qpegavalorconta.Open;
dmq.Qmovimento.ParamByName('SALDOANTERIOR').AsString:=dmq.QpegavalorcontaVALOR.AsString;
dmq.Qconta.edit;
dmq.QcontaVALOR.Value:=dmq.QpegavalorcontaVALOR.Value+dmq.QdocumentoTOTAL.Value;
dmq.Qconta.Post;
dmq.Qpegavalorconta.Close;
dmq.Qmovimento.ParamByName('SALDOATUAL').AsString:=dmq.QcontaVALOR.AsString;
dmq.Qmovimento.ParamByName('CODCONTA').AsString:=dmQ.QcontaCODIGO.AsString;

dmq.Qmovimento.ParamByName('CODRECEITADESPESA').AsString:=dmq.Qreceitadespesa.ParamByName('CODIGO').
AsString;
dmq.Qmovimento.ParamByName('DATA').AsString:=dmq.Qreceitadespesa.ParamByName('DATA').AsString
end;

------------------------
The problem happens when I try to launch almost simultaneously from
two pcs.

What is wrong or badly configured?

thanks.

[Non-text portions of this message have been removed]




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links