 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Cnemo Guest
|
Posted: Thu Jun 30, 2005 1:14 am Post subject: How preserve ChangeLog |
|
|
Hello!
Is there any way to ApplyUpdates but do not allow it clear ChangeLog?
I would like to have something like transaction for updating multiple cds in
memory.
I need to edit several tables independently
|
|
| Back to top |
|
 |
Kostas Terzides Guest
|
Posted: Thu Jun 30, 2005 9:41 am Post subject: Re: How preserve ChangeLog |
|
|
Cnemo wrote:
| Quote: | Hello!
Is there any way to ApplyUpdates but do not allow it clear ChangeLog?
I would like to have something like transaction for updating multiple cds in
memory.
I need to edit several tables independently
|
I don't think what you are trying to achieve is clear. Calling
ApplyUpdates is similar to trying to Commit a transaction. You can take
advantage of UndoLastChange, RevertRecord and SavePoint to mimic in
memory transactions, but all this has to be done before the "final
commit" (ApplyUpdates) is attempted.
You may want to wrap ApplyUpdates of more than one Cds in a single
transaction. In that case, take a look at my datasnap components
(http://cc.borland.com/Item.aspx?id=23068) and use
cds.BatchApplyUpdates. Alternatively, take a look at midess components
([url]http://sourceforge.net/projects/midess/)[/url].
If you want to implement an Undo mechanism that affects more than one
Cds (like a stack) then take a look at the Interbase example app
provided with my components.
|
|
| Back to top |
|
 |
mikeevteev@gmail.com Guest
|
Posted: Thu Jun 30, 2005 1:39 pm Post subject: Re: How preserve ChangeLog |
|
|
Hi Kostas!
Sorry, but i'll ask stupid questions. (I'm really tired and my brain
just doesnt want to do it's job).
Let say i have simple master-detail relation. The classic one, not
nested tables.
I need update both tables in one shot with all-or-nothing logic.
So, basically i need to do
StartTrans;
try
MasterCDS.ApplyUpdates;
DetaiCDS.ApplyUpdates;
CommitTrans;
execpt
RollBackTrans
end;
Lets say master is ok, but detail raised error. At this point master
already cleared it log, isn't it?
No questions, database will roll back transaction, but the client now
is inconsistent. Am i wrong?
I try to implement MVC, where model is based on the set of CDS.
Everything was just fine until i came to editing and got a need to sync
model and underlying data. Business logic is extracted in separate
class. So, basically i would like to call it, and then, if everything
is ok, commit changes in model. I do not want reread data from
database, because model is complex enough.
If i only have nested datasets, then provider will handle it for me.
But, seems like there is no naw to do it manually.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|