Why doesn't the nHibernate transaction object's IsActive property look at 
the connection to determine if its still active?

On Tuesday, July 27, 2010 at 6:01:22 AM UTC-4, Frans Bouma wrote:
>
> When you run into a 'zombied' transaction, it almost always means either 
> one
> of two things:
> 1) you shared the transaction object among threads
> or
> 2) the RDBMS rolled back the transaction by itself due to a severe error.
>
> 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
>
> > I am having the same problem, looking at the log files, I see that a
> > deadlock occurred "Transaction (Process ID 77) was deadlocked on lock
> > resources with another process and has been chosen as the deadlock 
> victim.
> > Rerun the transaction." I guess when a transaction deadlock occurs it
> > releases the connection. Do you have Nhibernate logging enabled? Did you
> > have a look in your log file? I don't know if there is an easier way to
> get
> > more info, I resort to the log file! :)
> > 
> > -----Original Message-----
> > From: [email protected] <javascript:> [mailto:
> [email protected] <javascript:>] On Behalf
> > Of cst
> > Sent: 27 July 2010 08:29
> > To: nhusers
> > Subject: [nhusers] Transaction not connected, or was disconnected
> > 
> > Hi,
> > 
> > I have a problem, i get this error:
> > 
> > NHibernate.TransactionException: Transaction not connected, or was
> > disconnected
> >    at NHibernate.Transaction.AdoTransaction.CheckNotZombied()
> >    at NHibernate.Transaction.AdoTransaction.Rollback()
> > 
> > Usually it happens once every 2 days in production, but somehow im 
> getting
> > it consistently in our test enviroment right now.
> > 
> > Im at a loss, to whats wrong. Any ideas? Somehow i can get more info??
> > 
> > Regards,
> > CSkydt
> > 
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected] 
> <javascript:>.
> > To unsubscribe from this group, send email to
> > [email protected] <javascript:>.
> > For more options, visit this group at
> > http://groups.google.com/group/nhusers?hl=en.
> > 
> > 
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected] 
> <javascript:>.
> > To unsubscribe from this group, send email to
> > [email protected] <javascript:>.
> > For more options, visit this group at
> > http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to