Re: BeginTrans

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 01/19/05


Date: Tue, 18 Jan 2005 21:03:30 -0600


>Using BatchOptimistic locking each user gets to work locally.
Using serverside cursors has each user working locally. BatchOptimistic extends
that by caching writes to the server until you updateBatch

>I think I then
>need to use a transaction to keep master and detail changes together. If
>there is a problem, and/or the user does not want to overwrite other edits,
>then rollback cleans up both master and details (or does it? Should I
>CancelBatch too?).
The transaction gets cleaned up on the server side but not on the client side.
For example you start a transaction and UpdateBatch on the Master and that
succeed, you then UpdateBatch on the Detail and that fails so you RollBack.
The data on the server should be the same as before you started the transaction
however the data in the Master TadoDataset.UpdateStatus will reflect that all
the records have been posted.
The Detail will reflect that the Records have not been posted.
If you want your clientside datasets to revert back to their state before
UpdateBatch then you need to clone the recordset before starting the UpdateBatch
so you have another copy to revert back to.

> On the other hand if the "error" is because the record
>(master of one of the details) has changed (using update criteria to detect
>this),
Update Criteria isn't going to help you find what error occurred.
You need to first look at the TadoConection.errors collection to see what errors
where generated and then at each record RecordSet.status property
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/his_2004Main/htm/_sna_status_property_oledb.asp
After that you can check each RecordSet field's UnderlyingValue against the
OrigianalValue to find where a field's value was changed after your clientside
cursor got its values.

> the user does not want to loose what they have entered even if they
>leave it on the screen just long enough to check with the boss etc. Not sure
>what state rollback leaves the local data.
>
>I'm sure I am not comming up with anything new here, even if I am not sure
>what I am doing!

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: Ado UpdateBatch vs CommitTrans
    ... >>UpdateBatch to call the method after the post of the record so that the ... >>changes are written on the server? ... > not be using BatchUpdateMode ... > changes then you need to use a transaction ...
    (borland.public.delphi.database.ado)
  • Re: UpdateBatch or Post changes state to dsBrowse
    ... problem regarding Master-Detail keys. ... I'm using a detail datasource that is linked to the master ... UpdateBatch everything after the user clicks the apply button. ... >If you are not using batchupdates you will get the database errors returned on ...
    (borland.public.delphi.database.ado)
  • Non-skipping order numbers and Master-Detail links
    ... order after all master and detail information has been entered. ... I issue a BeginTransaction right before calling my GetNextKey ... UpdateBatch) on the DETAIL table, the record just disappears, ... as if the foreign key was not set. ...
    (comp.lang.pascal.delphi.databases)
  • Non-skipping IDs with Master-Detail
    ... order after all master and detail information has been entered. ... UpdateBatch to minimize conflicts in a multi-user environment. ... I issue a BeginTransaction right before calling my GetNextKey ... for Master-detail link and create a separate OrderNumber field, ...
    (borland.public.delphi.database.ado)
  • Re: ADDNEW ADO
    ... > Beim Client dürfte UpdateBatch summa summarum die gleiche CPU Zeit ... > den SQL Server verschickt, ...
    (microsoft.public.de.access.clientserver)