M
mjwills1
We develop software used by banks and financial planners throughout
Australia.
On one particular site (out of thousands) we are getting an error:
This SqlTransaction has completed; it is no longer usable.
Server stack trace:
at System.Data.SqlClient.SqlTransaction.ZombieCheck()
at System.Data.SqlClient.SqlTransaction.Rollback()
at NAB.WM.SHAPE.HI.DataAccess.Dax.InsertAllDocumentData(Int32
documentTypeID, Boolean documentIsEncrypted, Int32 adaptorID, String
userName, String data, NameValueCollection keys, NameValueCollection
metaData)
The code of InsertAllDocumentData is very simple - it rollbacks on
error (Catch block) and commits otherwise (within Try). None of the
code that InsertAllDocumentData does or calls closes or disposes the
connection or the transaction.
In investigation I decompiled .NET 2.0 code and found that
SQLTransaction's ZombieCheck method calls
_internalTransaction.IsCompleted rather than
_internalTransaction.IsZombied (which seems a little odd):
Friend ReadOnly Property IsZombied As Boolean
Get
If (Not Me._internalTransaction Is Nothing) Then
Return Me._internalTransaction.IsCompleted
End If
Return True
End Get
End Property
Is that a bug in the framework? It seems odd to have a method called
IsZombied on the SqlInternalTransaction class but not to use it...
Australia.
On one particular site (out of thousands) we are getting an error:
This SqlTransaction has completed; it is no longer usable.
Server stack trace:
at System.Data.SqlClient.SqlTransaction.ZombieCheck()
at System.Data.SqlClient.SqlTransaction.Rollback()
at NAB.WM.SHAPE.HI.DataAccess.Dax.InsertAllDocumentData(Int32
documentTypeID, Boolean documentIsEncrypted, Int32 adaptorID, String
userName, String data, NameValueCollection keys, NameValueCollection
metaData)
The code of InsertAllDocumentData is very simple - it rollbacks on
error (Catch block) and commits otherwise (within Try). None of the
code that InsertAllDocumentData does or calls closes or disposes the
connection or the transaction.
In investigation I decompiled .NET 2.0 code and found that
SQLTransaction's ZombieCheck method calls
_internalTransaction.IsCompleted rather than
_internalTransaction.IsZombied (which seems a little odd):
Friend ReadOnly Property IsZombied As Boolean
Get
If (Not Me._internalTransaction Is Nothing) Then
Return Me._internalTransaction.IsCompleted
End If
Return True
End Get
End Property
Is that a bug in the framework? It seems odd to have a method called
IsZombied on the SqlInternalTransaction class but not to use it...