I was writing the 'what's a zombied ado.net transaction' story here
and then I saw this occurs inside the nhibernate code. :)
Do you share the session among threads (or asp.net requests) ? If
you look at the AdoTransaction class in the nhibernate sourcecode,
CheckNotZombied only throws if 'trans' is null or its connection object is
null, both are never set in the class itself, so its only triggered to throw
if another thread has set 'begun' to true and after that the rollback is
called.
Although it is indeed weird. Do you experience exceptions due to fk
constraint checks ? these roll back the transaction on the server (creating
a zombied ado.net transaction) which might trigger this too...
FB
Hi,
Regards,
CSkydt
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to
nhusers+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.
Point 1) is rare, but it could happen if you share things among asp.net
requests for example.
point 2) is more obscure. Every RDBMS at some point decides to roll back the
active transaction if an error occurs of a given severity level. Looking at
your deadlock remark, it sounds like sqlserver. SQL Server rolls back a
transaction on its own at severity level 19 or higher if I'm not mistaken.
You can lookup the severity level of a T-SQL error in the SQL Server books
online. If the error has a severity level of 19 or higher the current
'batch' is stopped and rolled back.
Looking at the deadlock error (1205) it seems it's severity level 13. So it
doesn't automatically rollback the transaction in the database.
however, that doesn't mean NHibernate doesn't do that for you. So you also
have to check whether you properly handle the error and continue/retry the
whole batch properly.
FB