Subject RE: [firebird-support] Steps to Set Wait/No Wait Transaction
Author Maya Opperman

Hi Vishal,

 

>I need to understand how to set Wait/No Wait Transaction in firebird.

I think you mean in Delphi? Might be better to ask on the Firebird tools group, but I have replied below

 

>Also I have one doubt that I when we start transaction through code as shown below,

the transaction locks particular rows in the table or it locks entire table?

I think you will be fine as long as you use generator to get your ID’s if you use auto-incremented numeric primary keys.

 

Delphi code snippet for FIBPlus would be:

 

sqlMain.Transaction.TPBMode := tpbDefault;

sqlMain.Transaction.TRParams.Clear;

                sqlMain.Transaction.TRParams.Add('read_committed');

sqlMain.Transaction.TRParams.Add('rec_version');

sqlMain.Transaction.TRParams.Params.Add('nowait');

//try

sqlMain.Transaction.StartTransaction;

try

 

    //Have Insert SQL Execution here

 

    sqlMain.Transaction.Commit;

except on E: Exception do

  begin

      sqlMain.Transaction.Rollback;

      raise;

  end;

end;

 

FireDac would  be quite similar.

 

Cheers

Maya