Hi,
We're experimenting with the plain SQL function in NHibernate using the SessionManager.Transaction.Enlist command.
Although, when using this, we get very regular this nasty error: "Begin failed with SQL exception "...
Actually, I don't have a clue why this would happen, or where to look for a reason...
Could anybody help me with this? We spend already a whole day on it :-/
Thanks a lot and kind regards,
Pieter
Hibernate version: 1.2.1.4000
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
(Inner Exception)
Application Domain: SocfincoInvoice.vshost.exe
Assembly Codebase: file:///D:/NET Projecten/MyProject/MyProject/bin/Debug/MyProject.EXE
Assembly Full Name: MyProject, Version=0.0.0.5, Culture=neutral, PublicKeyToken=null
Assembly Version: 0.0.0.5
Assembly Build Date: 21/01/2008 13:01:21
Exception Source: System.Data
Exception Type: System.Threading.ThreadAbortException
Exception Message: Thread was being aborted.
Exception Target Site: SNIPacketGetConnection
---- Stack Trace ----
.SNINativeMethodWrapper.SNIPacketGetConnection(packet As IntPtr)
MyProject.EXE: N 00122
System.Data.SqlClient.TdsParserStateObject.ProcessSniPacket(packet As IntPtr, error As UInt32)
MyProject.EXE: N 00067
System.Data.SqlClient.TdsParserStateObject.ReadSni(asyncResult As DbAsyncResult, stateObj As TdsParserStateObject)
MyProject.EXE: N 00147
System.Data.SqlClient.TdsParserStateObject.ReadPacket(bytesExpected As Int32)
MyProject.EXE: N 00034
System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
MyProject.EXE: N 00044
System.Data.SqlClient.TdsParserStateObject.ReadByte()
MyProject.EXE: N 00017
System.Data.SqlClient.TdsParser.Run(runBehavior As RunBehavior, cmdHandler As SqlCommand, dataStream As SqlDataReader, bulkCopyHandler As BulkCopySimpleResultSet, stateObj As TdsParserStateObject)
MyProject.EXE: N 00079
System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(buffer As Byte[], request As TransactionManagerRequestType, transactionName As String, isoLevel As TransactionManagerIsolationLevel, timeout As Int32, transaction As SqlInternalTransaction, stateObj As TdsParserStateObject, isDelegateControlRequest As Boolean)
MyProject.EXE: N 00649
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(transactionRequest As TransactionRequest, transactionName As String, iso As IsolationLevel, internalTransaction As SqlInternalTransaction, isDelegateControlRequest As Boolean)
MyProject.EXE: N 00366
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(transactionRequest As TransactionRequest, name As String, iso As IsolationLevel, internalTransaction As SqlInternalTransaction, isDelegateControlRequest As Boolean)
MyProject.EXE: N 00168
System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(iso As IsolationLevel, transactionName As String)
MyProject.EXE: N 00335
System.Data.SqlClient.SqlInternalConnection.BeginTransaction(iso As IsolationLevel)
MyProject.EXE: N 00009
System.Data.SqlClient.SqlConnection.BeginDbTransaction(isolationLevel As IsolationLevel)
MyProject.EXE: N 00055
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction()
MyProject.EXE: N 00010
NHibernate.Transaction.AdoTransaction.Begin(isolationLevel As IsolationLevel)
MyProject.EXE: N 00255
(Outer Exception)
Application Domain: MyProject.vshost.exe
Assembly Codebase: file:///D:/NET Projecten/MyProject/MyProject/bin/Debug/MyProject.EXE
Assembly Full Name: MyProject, Version=0.0.0.5, Culture=neutral, PublicKeyToken=null
Assembly Version: 0.0.0.5
Assembly Build Date: 21/01/2008 13:01:21
Exception Source: NHibernate
Exception Type: NHibernate.TransactionException
Exception Message: Begin failed with SQL exception
Exception Target Site: Begin
---- Stack Trace ----
NHibernate.Transaction.AdoTransaction.Begin(isolationLevel As IsolationLevel)
SocfincoInvoice.EXE: N 00412
NHibernate.Transaction.AdoTransaction.Begin()
SocfincoInvoice.EXE: N 00028
NHibernate.Impl.ConnectionManager.BeginTransaction()
SocfincoInvoice.EXE: N 00039
NHibernate.Impl.SessionImpl.BeginTransaction()
SocfincoInvoice.EXE: N 00041
MyCompany.BaseFramework.DataAccessLayer.SessionManager.TransactionStart()
SessionManager.vb: line 0155, col 21, IL 0032
Name and version of the database you are using: SQL 2005 SP2
|