Transaction Issues with SQL Server 2008R2 (SQL 2005 Compatibility Mode)

529 views
Skip to first unread message

Jeff N

unread,
May 26, 2012, 2:30:56 AM5/26/12
to FluentMigrator Google Group
I'm getting the error:

System.Exception occurred
Message=An error occured executing the following sql:
INSERT INTO [dbo].[VersionInfo] ([Version], [AppliedOn]) VALUES
(201110210041, '2012-05-26T06:26:43')
The error was The transaction associated with the current connection
has completed but has not been disposed. The transaction must be
disposed before the connection can be used to execute SQL statements.

Source=FluentMigrator.Runner
StackTrace:
at
FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String
sql)
at
FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.Process(String
sql)
at
FluentMigrator.Runner.Processors.ProcessorBase.Process(InsertDataExpression
expression)
at
FluentMigrator.Expressions.InsertDataExpression.ExecuteWith(IMigrationProcessor
processor)
at FluentMigrator.Runner.VersionLoader.UpdateVersionInfo(Int64
version)
at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(Int64
version)
at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean
useAutomaticTransactionManagement)
at FluentMigrator.Runner.MigrationRunner.MigrateUp()

Message=The transaction associated with the current connection
has completed but has not been disposed. The transaction must be
disposed before the connection can be used to execute SQL statements.
Source=System.Data
StackTrace:
at
System.Data.SqlClient.SqlInternalConnectionTds.CheckEnlistedTransactionBinding()
at
System.Data.SqlClient.TdsParser.TdsExecuteSQLBatch(String text, Int32
timeout, SqlNotificationRequest notificationRequest,
TdsParserStateObject stateObj)
at
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String
methodName, Boolean async)
at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String
sql)
InnerException:


Among my other migrations, I have a one migration that takes 10+
minutes to run (this is expected). This migration uses Execute.Sql
(that's the only thing in it). Using IntelliTrace, The INSERT INTO
VersionInfo above is for this migration...and the INSERT is executed
right after my migration runs.
er of rows affected.

It seems to bomb out with the above error at 10 minutes. I can't be
sure, since no timeout issue is being thrown...but I'm assuming this
is a timeout issue given the exact 10 minute nature.

I have all timeouts set to 0 (and I've tried really high values like
65536 too) (on the SqlConnection, ProcessorOptions and RunnerContext).

As said in the subject, I'm using SqlServerProcessor with
SqlServer2005Generator.

Any ideas?
Reply all
Reply to author
Forward
0 new messages