Code first migrations downward migration oracle error

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
John Liu
Posts: 61
Joined: Wed 14 Nov 2012 20:58

Code first migrations downward migration oracle error

Post by John Liu » Wed 14 Nov 2012 21:33

Devart provider for oracle version 7.2.114.0, direct connect, code first migration downward migration generates the following error:
Devart.Data.Oracle.OracleException: ORA-01460: unimplemented or unreasonable conversion requested
Steps to reproduce the error (http://msdn.microsoft.com/en-us/data/jj591621)
1. public class Blog
{ public int BlogId { get; set; }
public string Name { get; set; }
}
add-migration "v1" --- OK
2. update-database -targetmigration "V1" ----OK
( run update-database -targetmigration $initialdatabase ---OK)
3. add public string Url { get; set; } to Blog class
4. add-migration "V1SP1" ----OK
5. update-database -targetmigration "V1SP1" ----OK
6. update-database -targetmigration "V1"
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
System.Data.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> Devart.Data.Oracle.OracleException: ORA-01460: unimplemented or unreasonable conversion requested
at Devart.Data.Oracle.t.d()
at Devart.Data.Oracle.ar.h()
at Devart.Data.Oracle.ar.c()
at Devart.Data.Oracle.aa.a(Int32 A_0, by A_1)
at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at Devart.Data.Oracle.Entity.w.a(CommandBehavior A_0)
at Devart.Data.Oracle.Entity.w.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Entity.Migrations.History.HistoryRepository.GetMigrationId(String migrationName)
at System.Data.Entity.Migrations.DbMigrator.GetMigrationId(String migration)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
An error occurred while executing the command definition. See the inner exception for details.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Code first migrations downward migration oracle error

Post by Shalex » Thu 15 Nov 2012 13:08

There is a known bug (ORA-01460) in 7.2.114 with the NVARCHAR parameters in the Direct mode. The fix is available in the new (7.2.122) build of dotConnect for Oracle: http://forums.devart.com/viewtopic.php?f=1&t=25287. Please try 7.2.122. If it doesn't help, give us the following information:
1) specify the '-Verbose' flag to view the SQL statements being applied to the target database on the 6-th step from your post and show the generated SQL;
2) the exact version of EntityFramework.dll used;
3) send us a small test project for reproducing (or specify all non-default settings applied).

John Liu
Posts: 61
Joined: Wed 14 Nov 2012 20:58

Re: Code first migrations downward migration oracle error

Post by John Liu » Thu 15 Nov 2012 17:01

Version 7.2.122 fixed my problem.
Thanks so much!

Post Reply