Transaction Control on TDataSetProvider's InternalGetRecords and InternalApplyUpdates


2007-06-19 11:42:27 AM
off-topic2
Hi,
I have a question regarding the usage of Master/Detail DataSet with
DataSnap.
I use the following:
a. Delphi 2006 + DBX 3
b. Delphi 2007 + DBX 4
My application connect to Interbase/Firebird database via TClientDataSet
+ TDataSetProvider + TSQLDataSet (master and detail) + TSQLConnection.
There are 2 kind of operations to access database:
1. Open
2. ApplyUpdates
When I trace the source code of TDataSetProvider class, I found that
InternalApplyUpdates manage the transaction (start, commit and rollback)
but InternalGetRecords doesn't. Why is it so? Shouldn't the
TClientDataSet.Open for nested dataset also perform in a single
transaction to enforce atomicity of database operation?
I tend not to manage the transaction in client side as it is not
encourage in DataSnap application. The transaction management should be
done in middle tier (TDataSetProvider).
Although the DBX driver for Interbase may start transaction
automatically. But the commit retain at the end of operation doesn't
seems good.
I guess there are many here encounter the same problem but perhaps many
aren't aware of this. Most of us just concentrate on ApplyUpdates that
works pretty well in nested operation. However, the Open operation
should also design to work in similar way.
--
Best regards,
Chau Chee Yang
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting