Error in Migrations.cs: The transaction object is not associated with the same connection object as this command. #14450
Replies: 1 comment
-
It may depend on what your recipe does, recipe steps run in their own scope and then session and transaction. But normally this is not the case for a migration recipe, unless maybe if this recipe has nested recipes. You didn't see the error before because I assume that you added What we do for our modules and what you can do is to update your In your case copy/paste the code of Note: Maybe not always simple copy/paste, for example if you add columns to the same table in different steps, you can do that in one pass when updating |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now I am in the process of upgrading from OrchardCore 1.5 to 1.7 and one of the problems that I am having is I am getting this error in Migrations.cs in our tests.
2023-10-06 14:50:03.2015|Default|00-ab4220becb07519fe0664fc24019953b-b8b03225cb759077-00||OrchardCore.Data.Migration.DataMigrationManager|ERROR|Error while running migration version 1 for 'AdvancedForms'. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: The transaction object is not associated with the same connection object as this command.
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action
2 paramReader) in /_/Dapper/SqlMapper.cs:line 2848 at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command) in /_/Dapper/SqlMapper.cs:line 581 at YesSql.Sql.SchemaBuilder.Execute(IEnumerable
1 statements)at YesSql.Sql.SchemaBuilder.CreateMapIndexTable(Type indexType, Action
1 table, String collection) at YesSql.Sql.SchemaBuilderExtensions.CreateMapIndexTable[T](ISchemaBuilder builder, Action
1 table, String collection)at AdvancedForms.Migrations.UpdateFrom1() in C:\Users\Admin\source\repos\GovBuilt-Platform\src\GovBuilt.Citizen.Services\AdvancedForms\Migrations.cs:line 36
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span
1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId) at System.RuntimeMethodHandle.InvokeMethod(Object target, Span
1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId)
Beta Was this translation helpful? Give feedback.
All reactions