Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO: RollbackTrans does not revise OriginalValue?
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00737345
Message ID:
00737395
Views:
23
Hey Eric. I just duplicated this as well. I guess you need/want to requery after the rollback. To be quite honest, this is probably good practice anyway since the values might have changed in the interim.



>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
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform