BACKGROUND:
Creating the start of a web app with NH3 using HttpModule to manage the creation/commit/rollback of the transaction and session. In a scenario where an error occurs, i would like to return a simple message back to the user, but rollback the transaction. Hooking into the context.Error event, allows easy rollback upon an exception, however, this will never be called since exceptions are being caught, displaying a friendly message to the user.
Due to the issue above i am going to create a custom unit of work scenario, and store it in the Http Context for the request. If an error occurs, set a RollbackRequired flag, and have the unit of work perform rollback based on this. Storing in the session in the HttpContext - Is this the same as using CurrentSessionContext?
If anyone has other thoughts i'd be great.
Thanks.