How to start readonly transaction with TSQLConnection..
How to start readonly transaction with TSQLConnection..
Hi
i have devart dbExpress driver for Firebird with source code but without access components.
How can i start read only transaction with TSQLConnection or TCRSQLconnection?
KB
i have devart dbExpress driver for Firebird with source code but without access components.
How can i start read only transaction with TSQLConnection or TCRSQLconnection?
KB
Hello,
To start a read-only transaction, you should use the following code:
To start a read-only transaction, you should use the following code:
Code: Select all
procedure TMainForm.BitBtnClick(Sender: TObject);
var
tr: TTransactionDesc;
begin
SQLConnection.Open;
tr.IsolationLevel := xilCUSTOM;
tr.CustomIsolation := 1; // flag that transaction is read-only
SQLConnection.StartTransaction(tr);
end;
-
- Posts: 9
- Joined: Wed 27 Nov 2013 00:09
Re: How to start readonly transaction with TSQLConnection..
Hello,
I'm trying trial version of your components, because I need read-only trans.
I use C++Builder XE.
I installed driver from package, and then I changed library in TSQLConnection to dbexpida40.dll, and set up trans. desc. as you write. But newly opened trans. is not read-only.
What I should do, to do it correctly?
I'm trying trial version of your components, because I need read-only trans.
I use C++Builder XE.
I installed driver from package, and then I changed library in TSQLConnection to dbexpida40.dll, and set up trans. desc. as you write. But newly opened trans. is not read-only.
What I should do, to do it correctly?
Code: Select all
TTransactionDesc td;
td.TransactionID = 1;
td.IsolationLevel = xilCUSTOM;
td.CustomIsolation = 1; //ciREADONLY;
SQLConnection1->StartTransaction(td);
Re: How to start readonly transaction with TSQLConnection..
Thank you for the information. We have reproduced this problem. It occurs because the TSQLConnection.StartTransaction method ignores the xilCUSTOM isolation level. Here it is:As you can see, the xilCUSTOM isolation level is ignored, instead the ReadCommitted isolation level is used.
To avoid this problem, we added a workaround in our driver. Now, to use the custom read-only transaction, you should use the following code:
This workaround will be available in the next dbExpress driver for InterBase and Firebird build.
Code: Select all
procedure TSQLConnection.StartTransaction( TransDesc: TTransactionDesc);
var
Isolation: TDBXIsolation;
begin
case TransDesc.IsolationLevel of
xilREADCOMMITTED:
Isolation := TDBXIsolations.ReadCommitted;
xilREPEATABLEREAD:
Isolation := TDBXIsolations.RepeatableRead;
xilDIRTYREAD:
Isolation := TDBXIsolations.DirtyRead;
// xilCUSTOM:
else
Isolation := TDBXIsolations.ReadCommitted;
end;
BeginTransaction(TransDesc, Isolation);
end;
To avoid this problem, we added a workaround in our driver. Now, to use the custom read-only transaction, you should use the following code:
Code: Select all
SQLConnection1->Open();
TDBXTransaction* tr;
tr = SQLConnection1->BeginTransaction(5); // TDBXIsolations.SnapShot + 1
-
- Posts: 9
- Joined: Wed 27 Nov 2013 00:09
Re: How to start readonly transaction with TSQLConnection..
Thank you for quick answer, but I should set up something more - because it failed
I hope the images will work.
Thanks a lot, Tom
I hope the images will work.
Thanks a lot, Tom
Re: How to start readonly transaction with TSQLConnection..
As I wrote you above, this workaround will be available in the next dbExpress driver for InterBase and Firebird build. You cannot use it with the current version of dbExpress driver for InterBase and Firebird.
-
- Posts: 9
- Joined: Wed 27 Nov 2013 00:09
Re: How to start readonly transaction with TSQLConnection..
Sorry,
I understand it that the CustomIsolation will work in next version, and BeginTransaction(5) works now.
Ok, I will wait - do you know some time aproximation of new release?
Best regards
Tom
I understand it that the CustomIsolation will work in next version, and BeginTransaction(5) works now.
Ok, I will wait - do you know some time aproximation of new release?
Best regards
Tom
Re: How to start readonly transaction with TSQLConnection..
We plan to release all dbExpress drivers as soon as Update 2 for RAD Studio XE5 is released.
-
- Posts: 9
- Joined: Wed 27 Nov 2013 00:09
Re: How to start readonly transaction with TSQLConnection..
Hi, RAD Studio Update 2 is on the net, how about your components
This feature is very important for us, so we need to test it before we buy it.
And the time flow so fast...
Thanky you in advance
Tom
This feature is very important for us, so we need to test it before we buy it.
And the time flow so fast...
Thanky you in advance
Tom
Re: How to start readonly transaction with TSQLConnection..
We plan to release all DAC products with RAD Studio XE5 Update 2 support next week. After this, we will release all dbExpress drivers.
But if you need this fix as soon as possible, we can send you a custom build with this fix. Please send your dbExpress driver for InterBase and Firebird license number to andreyz*devart*com .
But if you need this fix as soon as possible, we can send you a custom build with this fix. Please send your dbExpress driver for InterBase and Firebird license number to andreyz*devart*com .
-
- Posts: 9
- Joined: Wed 27 Nov 2013 00:09
Re: How to start readonly transaction with TSQLConnection..
I need demo version - because we did not buy it yet - we need this functionality - so we are searching for dbexpress component that allows it.