Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
startTransaction for multiple appends to same table |
Thu, Apr 6 2006 4:11 AM | Permanent Link |
Dhaval Shah | Hi peers & Tim,
I'm appending multiple records from a memory table to another table due to the validations, some records don't validate and the loop stands still. I'm wondering if StartTransaction..commit..rollback would help me with that. But again, will it "rollback" the "posted" record(s) too?? for ex. With memoryTable do While not eof do begin Table2.append; Table2.FieldbyName.... Table2.Post; <-- Next; end; If i put this in the database transaction try..except it'd be if not Database.Intransaction then Database.StartTransaction; try With memoryTable do While not eof do begin Table2.append; Table2.FieldbyName.... Table2.Post; <-- Next; end; Database.Commit; except Database.Rollback; end; Will that revert the previous posted records IF any of the records throws an exception?? for ex. record 1 - OK (appended and posted) record 2 - OK (appended and posted) record 3 - value(s) didn't validate and so threw an exception Regards --- Dhaval Shah Sr. Software Developer Perth, Australia |
Thu, Apr 6 2006 4:40 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dhaval,
<< Will that revert the previous posted records IF any of the records throws an exception?? >> Yep, as long as you throw a valid Exception or descendant that triggers the except block and executes the rollback. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, May 1 2006 2:52 AM | Permanent Link |
Dhaval Shah | Tim Young [Elevate Software] wrote:
> Dhaval, > > << Will that revert the previous posted records IF any of the records throws > an exception?? >> > > Yep, as long as you throw a valid Exception or descendant that triggers the > except block and executes the rollback. > cool. thanks Tim (sorry for the late response) --- Dhaval Shah Sr. Software Developer Perth, Australia |
This web page was last updated on Thursday, March 28, 2024 at 06:05 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |