In the book I have on Firebird shows when using a transaction type Concurrency, and that Firebird supports this type.
But all the examples I see are always ReadCommitted.
I've tried to configure Concurrency, but does not have this type in the options that appear.
Is that right?
Do not have this option?
And how I do to set "wait" (that wait for the solution of a conflict)
Can anyone help-me with the code ?
Thanks
Devart 270
Delphi 2010
Firebird 2.51
Devart Drive for DBEXPRESS/Firebird only supports transactions like ReadCommitted ?
Re: Devart Drive for DBEXPRESS/Firebird only supports transactions like ReadCommitted ?
Hello,
To start Concurrency transactions, you can use the following code:To set the wait parameter of a transaction, you should use the WaitOnLocks connection option. Here is a code example:You can find more information in the dbExpress driver for InterBase & Firebird documentation (the Readme.html file).
To start Concurrency transactions, you can use the following code:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
tr: TTransactionDesc;
begin
tr.IsolationLevel := xilREPEATABLEREAD;
SQLConnection1.Open;
SQLConnection1.StartTransaction(tr);
end;
Code: Select all
SQLConnection1.Params.Values['WaitOnLocks'] := 'True';
Re: Devart Drive for DBEXPRESS/Firebird only supports transactions like ReadCommitted ?
Very grateful for the response.
I had found this type, but could not confirm the information, that xilREPEATABLEREAD is the Concurrency, until you wrote.
But now I have more one question, please read the code below.
tr.IsolationLevel := xilREPEATABLEREAD;
SQLConnection1.Open;
SQLConnection1.StartTransaction(tr);
In your examples, you never numbering transaction !
I do so:
inc(igTrans);
tr.TransactionId:= igTrans ;
Tr.Isolationlevel......
So,does it make any difference?
Or no need to identify the number of the transaction to avoid conflict, or same by any other reason.
I can to stop to do so ?
Thanks
I had found this type, but could not confirm the information, that xilREPEATABLEREAD is the Concurrency, until you wrote.
But now I have more one question, please read the code below.
tr.IsolationLevel := xilREPEATABLEREAD;
SQLConnection1.Open;
SQLConnection1.StartTransaction(tr);
In your examples, you never numbering transaction !
I do so:
inc(igTrans);
tr.TransactionId:= igTrans ;
Tr.Isolationlevel......
So,does it make any difference?
Or no need to identify the number of the transaction to avoid conflict, or same by any other reason.
I can to stop to do so ?
Thanks
Re: Devart Drive for DBEXPRESS/Firebird only supports transactions like ReadCommitted ?
If you specify the TransactionID property, it means that you want to start another transaction. Here is a code example that demonstrate this:So, if you want to use multiple transactions, you should specify the TransactionID property for each of them.
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
tr: TTransactionDesc;
begin
FillChar(tr, sizeof(TTransactionDesc), 0);
tr.TransactionID := 1;
tr.IsolationLevel := xilREADCOMMITTED;
SQLConnection1.Open;
SQLConnection1.StartTransaction(tr); // here a new transaction with TransactionID=1 is started
SQLConnection1.StartTransaction(tr); // here nothing happens, because it is the same transaction
tr.TransactionID := 2;
SQLConnection1.StartTransaction(tr); // here a new transaction with TransactionID=2 is started
end;