Cached updates: rollback and keep editing

nicofari

Member²
Hello,

D5 DOA 4.0.3 Oracle 9.2

I have a TOracleDataset in CachedUpdates mode.
I need to do some validity checks after ApplyUpdates(False)
If check fails I do not Rollback but my dataset is no more in edit state.
If I try to put in edit programmatically I can see with OracleMonitor that the OracleDataset doesn't generate the same sql anymore.
If, for example, at the first attempt you can see an "UPDATE MyTable SET ...."
After validity check fail I changed the offending field, but my check still fails.
So I looked in OracleMonitor and I saw that the update statement wasn't there. So the check still sees the previous, and wrong, value.
It seems that the OracleDataset doesn't generate the update statement anymore..
( I hope it is clear )
Thanks very much in advance for any tips/help on this!
Bye
Nicola
 
PS
Obviously tt seems that TOracleDataset tries to determine if and which fields are changed.
So the second time it doesn't generate the SQL statement but I actually changed one of them.
Is there any way to force re-evaluate the status of the change log, or something similar (I guess it would be quite dangerous....)?
 
PPS
Well investigating further it seems that my problem is this:
when I put in edit my TOracleDataset, he/she doesn't generate an SQL select, so his/her buffer becomes out of date.
What can be the cause of this?
I have autoedit=False
DefaultValues=True
CachedUPdates=True
RequiredFields = True
In RefreshOptions I enabled roBeforeEdit and roAfterInsert
The oracle table is a GTT with preserve on commit
 
If you perform a validity check after calling TOracleSession.ApplyUpdates(False), then you must call TOracleSession.Rollback in case of a validity check violation to restore the database to the situation from before the ApplyUpdates.

After that, you can make additional changes and call ApplyUpdates again.
 
Back
Top