Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Practice for handling transactions in Mere Mortals.
Message
From
04/08/2009 17:43:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
04/08/2009 09:05:42
Tegron Tegron
Platinum Technologies
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01416042
Message ID:
01416093
Views:
54
>What is the best practice for using transactions in Mere Mortals? I read the information on transactions in the developer guide, and I tried implementing it before with some issues. I don't recall exactly the problem, but I know that I was having problems with it saving the children before when I tried using it. I had two tables (a parent and a child). I had the parent basically instantiating the child like in the doc. I had AutoSaveOnParentSaved set, and I remember an error being thrown this way.
>
>I am at the stage of having to use this scenario again, and I would like to wrap these into a transaction. Basically I am reading in information from a file that contains check payment information. The header contains the total amount of each line item. The line items detail how the check was split. I am reading this information into two tables. I want it to be a transaction, so if it fails everything will rollback. I would like suggestions as to how I should implement this using business objects from a best practice standpoint.

I don't know if there is a best practice. You can do as you suggest in your post to make sure you register a child to a parent and set AutoSaveOnParentSaved property and let the framework take care of it. If you find you still have an error, post it and we can try to figure it out. Also, you can wrap your own transactions manually if you prefer.
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform