Transactions and ClientDataSet with PacketRecords

Transactions and ClientDataSet with PacketRecords

Postby eliseu_corrona » Fri 29 Jan 2016 18:41

Hi.
I would just take a doubt about read-only transactions and ClientDataSet using the PacketRecords feature.

We use Delphi XE with update 1, Firebird 2.5.5 and Devart Corelab for Interbase/Firebird version 4.4.6.0. In our system, the transaction control is explicit . We control manually to ensure that most of the transactions be managed. In querys, we use read-only transactions. We identify a situation when are used read-only or read committed transactions in a TClientDataSet with PacketRecords .

First, start the transaction , then open the DataSet and finalize the transaction. We note that the transaction remains open until the ClientDataSet fetch all data. The sometimes transaction is finished automatically. Other sometimes not. To monitor the processes we use Sinatica Software (http://www.sinatica.com/index.php/en) .

Code block sample:

Code: Select all
Procedure TForm2.BtnOpenDataSetClick(Sender: TObject);
Var
  LTransaction: TDBXTransaction;

Begin
 
  CdsCustomer.PacketRecords := 30;
  CdsCustomer.Close;

  Try
    LTransaction := StartTransactionReadOnly;
   
   CdsCustomer.Open;

   //Transaction not finshed because SQLConnection not in InTransaction.
  CommitTransaction(LTransaction);

  Except
    RollBackTransaction(LTransaction);
  End;

End;


Based on this, I have the following questions:

1 ) Is it possible manage manually and securely a transaction in querys using ClientDataSet with PacketRecords?

2 ) Is it possible that due to demand of connections and process, corelab driver not manage with 100% efficient the transactional control?

Regarts.
eliseu_corrona
 
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Re: Transactions and ClientDataSet with PacketRecords

Postby eliseu_corrona » Mon 08 Feb 2016 10:11

Hi Devart Team.
Any news about my question?
eliseu_corrona
 
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Re: Transactions and ClientDataSet with PacketRecords

Postby ViktorV » Tue 23 Feb 2016 11:42

This behavior of our driver is correct. Since InterBase/Firebird requires an active transaction for each operation with data, the active transaction remains open until all the data is retrieved. When using the PacketRecords property, data is read out by blocks, and until the last block is retrieved, in other words, the end of the dataset is reached, the transaction will remain open. This behavior is related not to dbExpress driver for InterBase & Firebird, but to the dbExpress technology. Unfortunately we can't affect it.
ViktorV
Devart Team
 
Posts: 1831
Joined: Wed 30 Jul 2014 07:16

Re: Transactions and ClientDataSet with PacketRecords

Postby eliseu_corrona » Tue 23 Feb 2016 11:52

Hi ViktorV. Thanks for your answer and clarification.

Regarts,

Eliseu Corrona.
eliseu_corrona
 
Posts: 11
Joined: Wed 18 Mar 2009 19:25
Location: Brazil

Re: Transactions and ClientDataSet with PacketRecords

Postby ViktorV » Tue 23 Feb 2016 12:06

If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.
ViktorV
Devart Team
 
Posts: 1831
Joined: Wed 30 Jul 2014 07:16


Return to dbExpress driver for InterBase & Firebird