使用entityframework fluent api的第一个dataaccess方法,oracle数据库中的Dev Art低于错误。
实际的表格设计:
此查询失败。
CREATE TABLE DADeskSettings (
UserID NVARCHAR2(2000) NOT NULL,
Password NVARCHAR2(2000) NOT NULL,
DADeskURL NVARCHAR2(2000) NOT NULL,
WebURL NVARCHAR2(2000) NOT NULL,
IsDADeskSettings NUMBER(1) NOT NULL,
DAType VARCHAR2(4 CHAR) NOT NULL,
UPDATEDADESK NUMBER(1) NOT NULL,
isshortseavoy NUMBER(1) NULL,
CreatedBy VARCHAR2(8 CHAR) NULL,
UpdatedBy VARCHAR2(8 CHAR) NULL,
CONSTRAINT PK_DADeskSettings PRIMARY KEY (UserID, Password, DADeskURL, WebURL, IsDADeskSettings, DAType)
)
ORA-01450: maximum key length (6398) exceeded
但它适用于entityframework edmx model + devArt。有什么建议吗?
var dummy2 = ContextFactory.Db.GetQuery<OPRPortCall>().Select(x=>x.AccountCode).FirstOrDefault(); //this is one of the line.
*** Client Application Says ***
- ORA-01450: maximum key length (6398) exceeded (Devart.Data.Oracle.OracleException)
- The type initializer for 'Server.ManagerService.Registers.LookupVmSvc' threw an exception. (System.TypeInitializationException)
- Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
Stacktrace
*** Client Application Says ***
at Devart.Data.Oracle.bh.d(Int32 A_0)
at Devart.Data.Oracle.de.a(Int32 A_0, z 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.Data.Oracle.OracleCommand.ExecuteNonQuery()
at Devart.Common.Entity.ej.a(DbConnection A_0, Nullable`1 A_1, b3 A_2)
at Devart.Common.Entity.ej.a(DbConnection A_0, Nullable`1 A_1)
at Devart.Data.Oracle.Entity.OracleEntityProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
at System.Data.Entity.Internal.DatabaseOperations.Create(ObjectContext objectContext)
at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.AsNoTracking()
at System.Data.Entity.Infrastructure.DbQuery`1.AsNoTracking()
at Server.Manager.DataAccess.VMEntities.GetQuery[T](Boolean tracking)
答案 0 :(得分:1)
请启用dbMonitor工具并指定无法执行的确切SQL语句:https://www.devart.com/dotconnect/oracle/docs/?dbmonitor.html。
尝试设置config.CodeFirstOptions.TruncateLongDefaultNames = true。这有帮助吗? https://www.devart.com/dotconnect/oracle/docs/?CodeFirstOptions.html
答案 1 :(得分:1)
SQL> create tablespace TS_DATA_16 datafile '+DATA' size 100M blocksize 16k; SQL> alter user your_schema quota unlimited on TS_DATA_16; SQL> drop table your_table; SQL> create table your_table ( ... ) tablespace TS_DATA_16;