Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO: RollbackTrans does not revise OriginalValue?
Message
From
02/01/2003 11:14:56
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
ADO: RollbackTrans does not revise OriginalValue?
Miscellaneous
Thread ID:
00737345
Message ID:
00737345
Views:
74
I have an odd scenario, and I suspect that I must be missing something obvious, but am having no luck with web and archive searches.

Our business logic works as follows (Fox-like pseudocode, error checking excluded):

FUNCTION BusinessObject.Save()
Connection.BeginTrans()
IF THIS.Verify()
AdoRecordSet.UpdateBatch()
ENDIF
FOR EACH ChildBizObject
ChildBizObject.Save()
ENDFOR
IF THIS.AnythingFailed
Connection.RollbackTrans()
ELSE
Connection.CommitTrans()
ENDIF
ENDFUNC

The problem is that for a new record (appended locally, edited in UI), the value of AdoRecordSet.Fields('x').OriginalValue changes during UpdateBatch(), but does not revert during RollbackTrans(). If the user then corrects whatever caused the error and retries, I get a concurrency error stating that the record has been deleted. (I suspect that the AdoRecordSet is trying to issue an Update instead of re-issuing an Insert.)

Does anyone have any suggestion for resolving the situation? My first thoughts were to manually null the original values or somehow force an insert, or perhaps find a way to make the OriginalValue fields revert during the rollback, but I have not found any way to do so thus far.

Help is much appreciated.

. . . . . . . -- Eric
Next
Reply
Map
View

Click here to load this message in the networking platform