Transaction Problems with driver DevartInterbase 4.3.4

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Transaction Problems with driver DevartInterbase 4.3.4

Post by eurides.baptistella » Thu 09 Jan 2014 11:17

Hello,

I have a problem in the driver DevartInterbase can you help me?

Delphi: XE4
DevartInterbase: 4.3.4
Firebird: 2.5

Attached a project demonstrating the problem.

When running ClientDataSet.Refresh within a transaction, the data is not updated in ClientDataSet, the value of the changed field remains the old value. Only when the Commit runs and after a new ClientDataSet.Refresh the changed value is updated in ClientDataSet.
I know the example seems a bit confusing, but my application got it in several places. I'll try to better detail the problem:

Step one: Execute any query (using a SQLDataSet or SQLQuery) and leave the open component within the scope of the procedure:

Code: Select all

1. procedure TForm2.Button4Click(Sender: TObject);
2. begin
3.     SQLDataSet2.Close;
4.     SQLDataSet2.CommandText := 'select * from tb_teste';
5.     SQLDataSet2.Open;
6. end;
Note: Note that has not closed the SQLDataSet2 (SQLDataSet2.Close) ....

Second step: Within a transaction, run the update and a given, soon after, in the same transaction, run a refresh to reload the component information:

Code: Select all

1. procedure TForm2.Button1Click(Sender: TObject);
2. var
3.   Transacao: TDBXTransaction;
4. begin
5.     Transacao := SQLConnection_Devart.BeginTransaction
6.
7.     ClientDataSet1.Open;
8.     ClientDataSet1.Edit;
9.     ClientDataSet1_INCREMENTO.AsInteger := ClientDataSet1_INCREMENTO.AsInteger +1;
10.   ClientDataSet1.Post;
11.   ShowMessage('This is the information AFTER POST: ' + ClientDataSet1_INCREMENTO.AsString);
12. 
13.   ClientDataSet1.ApplyUpdates(0);
14.   ShowMessage('This is the information AFTER APPLY UPDATES: ' + ClientDataSet1_INCREMENTO.AsString);
15. 
16.   ClientDataSet1.Refresh;
17.   ShowMessage('This is the information AFTER REFRESH: ' + ClientDataSet1_INCREMENTO.AsString);
18. 
19.   SQLConnection_Devart.CommitFreeAndNil(Transacao)
20.   ShowMessage('This is the information AFTER COMMIT: ' + ClientDataSet1_INCREMENTO.AsString);
21. 
22.   ClientDataSet1.ReFresh;
23.   ShowMessage('This is the information AFTER NEW REFRESH: ' + ClientDataSet1_INCREMENTO.AsString);
24. end;
The code:
Line 5: Start a simple transaction;
Lines 7 to 10: We performed a simple process of changing data, just to simulate the problem;
Line 13: Execute a ApplyUpdates to persist data;
Line 16: Runs a refresh in ClientDataSet, let's imagine that the Update run a trigger on the table and we need the ClientDataSet.Refresh to reload the data were updated by the trigger (this is exactly the situation I have in my application), this is the reason to execute ClientDataSet.Refresh in this point;
Line 19: Commit the changes;
Line 22: A new refresh to check whether the data has been correctly saved.

The Problem:
1 - The problem occurs exactly in line 16, when performing a Refresh it should load the new information, however, he maintains that the information contained above, before starting the transaction;
2 - The problem only occurs when a Query is not closed in its scope;
3 - The problem occurs only in the second iteration, the second attempt (process) involving the transaction;
4 - The problem happens only using Devart Interbase Driver;
5 - The Driver Devart PostgreSQL does not have this defect;
6 - The Firebird Driver (native in Delphi XE4) does not have this defect, characterizing a bug of Driver Devart Interbase.


If you can help me, I thank you.

Regards...

eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by eurides.baptistella » Fri 10 Jan 2014 11:18

Hello ...
I need to know if you are analyzing the problem ...

Thank you!

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by ZEuS » Sat 11 Jan 2014 07:33

Thank you for the information.
We have reproduced the problem and investigation is in progress.
We will notify you when we have any results.

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by ZEuS » Mon 13 Jan 2014 09:45

We have fixed the issue and will include the fix in the nearest dbExpress driver for InterBase & Firebird build.

eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by eurides.baptistella » Mon 13 Jan 2014 12:19

Thanks for the work to identify and fix the problem!

I just like to have a date to inform my company about fixing the problem. The next build already has a date?

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by ZEuS » Tue 14 Jan 2014 09:27

We plan to release the next dbExpress driver for InterBase & Firebird build in the beginning of the next month.

eurides.baptistella
Posts: 9
Joined: Wed 12 Dec 2012 19:36

Re: Transaction Problems with driver DevartInterbase 4.3.4

Post by eurides.baptistella » Tue 14 Jan 2014 10:56

Thanks for the information!

Post Reply