Migrations don't work anymore (2.3.0, Oracle)
See original GitHub issueApologies that I am not (can not) use the latest version of Abp, and that I am using Oracle which you don’t usually support, but I could use some direction as to where the problem might be.
I have made a simple migration, which works completely fine through the Package-Manager-Console, but when trying to migration on Application startup, it fails, citing that it already has made a connection and can’t make another:
Connection is already part of a local or a distributed transaction
Oracle.ManagedDataAccess.Client.OracleConnection.BeginTransaction(IsolationLevel isolationLevel) +378 Oracle.ManagedDataAccess.Client.OracleConnection.BeginDbTransaction(IsolationLevel isolationLevel) +130 System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel) +10 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<BeginTransaction>b__0(DbConnection t, BeginTransactionInterceptionContext c) +9 System.Data.Entity.Infrastructure.Interception.InternalDispatcher
1.Dispatch(TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action
3 executing, Action3 executed) +576 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.BeginTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext) +341 System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsWithinNewTransaction(IEnumerable
1 migrationStatements, DbConnection connection, DbInterceptionContext interceptionContext) +138
System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable1 migrationStatements, DbConnection connection, DbInterceptionContext interceptionContext) +346 System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable
1 migrationStatements, DbConnection connection) +509
System.Data.Entity.Migrations.<>c__DisplayClass30.<ExecuteStatements>b__2e() +19
System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation) +9
System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable1 migrationStatements, DbTransaction existingTransaction) +194 System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable
1 migrationStatements) +7
System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String migrationId, VersionedModel targetModel, IEnumerable1 operations, IEnumerable
1 systemOperations, Boolean downgrading, Boolean auto) +828
System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration) +364
System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable1 pendingMigrations, String targetMigrationId, String lastMigrationId) +133 System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration) +446 System.Data.Entity.Migrations.<>c__DisplayClassc.<Update>b__b() +13 System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +422 System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +78 System.Data.Entity.MigrateDatabaseToLatestVersion
2.InitializeDatabase(TContext context) +108
System.Data.Entity.Internal.<>c__DisplayClassf1.<CreateInitializationAction>b__e() +76 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60 System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +357 System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7 System.Data.Entity.Internal.RetryAction
1.PerformAction(TInput input) +110
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action1 action) +198 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73 System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes() +60 System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext() +25 Abp.EntityFramework.AbpDbContext.RegisterToChanges() +27 Abp.Zero.EntityFramework.AbpZeroDbContext
3…ctor(String nameOrConnectionString) +29
Project.EntityFramework.ProjectDbContext…ctor(String nameOrConnectionString) in C:\User\Project.EntityFramework\EntityFramework\ProjectAbpContext.cs:176
`
I am really quite stuck. Do you know why there might already be another connection at this point?
Issue Analytics
- State:
- Created 6 years ago
- Comments:29 (29 by maintainers)
Top GitHub Comments
@Worthy7 it seems like oracle does not support ReadUnCommitted isolation level. You can change IsolationLevel in your EF module’s preinitialize like this:
Configuration.UnitOfWork.IsolationLevel = IsolationLevel.ReadCommitted;
I dropped down to old old versions of my app which worked fine, and even they couldn’t migrate automatically. So it is nothing to do with the .net project at all - it must be something external. I’ll close this.