Modifying default save behaviour

Posts   
 
    
happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 02-Dec-2008 07:08:24   

Oracle 11g, asp.net app.

I need to be able to call a stored procedure setting some transaction level variables (ex: username logged in) before any entity save. I don't want to pass these variables to each and every save. I'm hoping to set up a thread specific context (or maybe even just reference the system.web and access the current session state) and have the entities themselves always pull these variables to then call the stored procudure before issuing the actual save sql that I would need to have happen within the same transaction scope.

What would be the best way to tackle this?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-Dec-2008 09:35:42   

Derive from the DataAccessAdapter and override SaveEntity().

happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 02-Dec-2008 14:04:52   

Sorry, forgot to mention, using SelfServicing.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 02-Dec-2008 18:12:04   

Then override Save(IPredicate updateRestriction, bool recurse) in a partial class of the entity or if you're using two-class scenario, override it there .

Frans Bouma | Lead developer LLBLGen Pro