Purpose of ApplicationContext.LocalContext??

Purpose of ApplicationContext.LocalContext??

Old forum URL: forums.lhotka.net/forums/t/2074.aspx


DansDreams posted on Wednesday, January 03, 2007

I've read the brief explanation in the change log, but it doesn't give much background.  Particularly, I don't understand what the big advantage is over passing the connection as a parameter as was done previously.

Also, as it is currently demonstrated in the Resource.DataPortal_Update method in the PT application, isn't there a concern for it not getting cleared if there should be some error in the database save - i.e. shouldn't the clear at the end of the method be in a finally block of a try...finally?

JoeFallon1 replied on Wednesday, January 03, 2007

I previously posted some sample code that shows a good way to pass a transaction (tr) between 2 root BOs that are both contained in a Use Case Controller BO. This solves a longstanding issue for me of how to commit 2 (or more) root BOs in the same transaction (without using Enterprise Services or System.Transactions). I decided to continue passing the tr to contained child BOs as a parameter since all of my templates codegen that stuff anyway. I added some code to my base classes to support this scheme and modified my templates to build root BOs with this in mind. See the previous post for details.

Joe

 

Copyright (c) Marimer LLC