Are you by any chance using the HttpResponse.Redirect method?  That throws a 
ThreadAbortException to end the request immediately, which will cause any 
transaction to fail.  A good pattern is to either use the controllers Redirect 
methods (which do NOT throw an exception), or make your controllers 
non-transactional, delegate to a transactional service and then immediately 
call redirect after the service is finished.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Jan Limpens
Sent: Tuesday, May 05, 2009 3:16 PM
To: castle-project-users
Subject: nhibernate facility and automatic transaction management

Hello,

I am using the above mentioned services in my project, mark my controllers as 
[Transactional] and my actions as [Transaction(TransactionMode.Requires)]. 
Still it seems that sometimes my transactions are not committed (probably due 
to an exception somewhere in the controller/action).
This leads (at least that's my current main suspect) to timeouts when querying 
sql server.

Should this be like that? What could I do?

Thanks,
--
Jan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to