Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Apply multiple dataset updates in one transaction

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0
Anders Gustavsson

Posts: 26
Registered: 9/26/99
Apply multiple dataset updates in one transaction  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 6, 2016 11:59 PM
A long time ago I used code from Dan Miser's Midess package ( to implement cached updates for Paradox and later for NexusDB. Up to now the different layers have been kept together in one executable, so it was easy to let things mix up more than strict rules should really allow.

I am now in the process of upgrading to MS SQL implementing the data access layer with FireDAC, but I would like to keep what I have in the ClientDataset layer. AND I would like to make a clean cut between these two layers, maybe even making it possible to have them in separate applications.

So here is the problem, the central piece of the Midess data applying code:

procedure CDSApplyUpdates(ADatabase : TDatabase; var vDeltaArray: OleVariant; const vProviderArray: OleVariant; Local: Boolean);
  i : integer;
  LowArr, HighArr: integer;
  P: PArrayData;
  {Wrap the updates in a transaction. If any step results in an error, raise}
  {an exception, which will Rollback the transaction.}
      for i:=LowArr to HighArr do
        ApplyDelta(vProviderArray, P^, Local);

The vDeltaArray are the deltas from the updated clientdatasets. The vProviderArray is an array with information about the providers involved. Those two originate from the clientside application. But the transaction code for the ADatabase belongs to the serverside.

So what I would need is a way to send the vDeltaArray and the vProviderArray (and maybe a few other things too) from the one side to the other. My plan is to do it with the use of a DataSnap server. I have tried to pass the OleVariants but I keep getting errors like unknown datatypes and so on, and I can't figure out how to do it properly.

Any help would be appreciated. Even ideas of how to solve this with different scenarios are welcome, but as there are quite a lot of clientdataset logic to rebuild, really good arguments in their favour are needed :-)

Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02