- 3,716,134 Users
- 2,242,961 Discussions
- 7,845,841 Comments
Forum Stats
Discussions
Categories
- 17 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 1.6K Databases
- 479 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 5 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 417 SQLcl
- 42 SQL Developer Data Modeler
- 184.9K SQL & PL/SQL
- 21K SQL Developer
- 1.9K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 9 DevOps
- 3K QA/Testing
- 259 Java
- 6 Java Learning Subscription
- 11 Database Connectivity
- 67 Java Community Process
- 1 Java 25
- 9 Java APIs
- 141.1K Java Development Tools
- 6 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 125 LiveLabs
- 31 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 11 Español
- 1.9K Japanese
- 2 Portuguese
EF Core Beta3 : error ORA-12704: character set mismatch. Happens on a DbSet Select statement when ma
it looks like an auto generated query is created malformed.
Note the N'' instead of 'N' in the stack below.
Please find a working project that reproduce the bug in the link below,
https://github.com/ormarom/examples/tree/master/oracle/OracleError/OracleErrorExample
To run:
- Update the User Password and DataSource in the appsttings json file under connectionString:Oracle.
- Start debugging from the Program, the table will be created code first, so make sure the user has privileges.
- Then I add a few entities (works fine)
- Then I try to get the entities and Map them to a DTO using Select with a mapping expression.
- The crash is in the ToListAsync, in the system aggregate class with the error below.
Note that this works fine with MsSql provider.
Hope this helps, I would really appreciate a fix for this, thank you!
call stack:
Microsoft.EntityFrameworkCore.Query:Information: 2019-05-15 22:37:44.776788 ThreadID:1 (ENTRY) OracleQuerySqlGenerator.ctor() : OracleSQLCompatibility: 12
Microsoft.EntityFrameworkCore.Query:Information: 2019-05-15 22:37:44.788727 ThreadID:1 (SQL) OracleQuerySqlGenerator.GenerateLimitOffset() : Limit:null
Exception thrown: 'OracleInternal.Network.NetworkException' in Oracle.ManagedDataAccess.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.ManagedDataAccess.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.ManagedDataAccess.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.ManagedDataAccess.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.ManagedDataAccess.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
'iisexpress.exe' (CoreCLR: clrhost): Loaded 'c:\program files\dotnet\shared\Microsoft.NETCore.App\2.2.2\System.Reflection.Metadata.dll'. Cannot find or open the PDB file.
Microsoft.EntityFrameworkCore.Database.Command:Error: 2019-05-15 22:37:45.322761 ThreadID:1 (ERROR) OracleRelationalCommand.ExecuteAsync() : Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12704: character set mismatch
at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Database.Command:Error: Failed executing DbCommand (526ms) [Parameters=[], CommandType='Text', CommandTimeout='0']
SELECT CASE
WHEN "domain"."PRJP_AUT_HOST_POOL_ID" IS NOT NULL
THEN CAST("domain"."PRJP_AUT_HOST_POOL_ID" AS VARCHAR2(11)) ELSE N''
END "AutPoolID", "domain"."PRJP_CONCURRENT_RUNS" "ConcurrentRuns", CASE
WHEN "domain"."PRJP_DIAGNOSTICS_SERVER_ID" IS NOT NULL
THEN CAST("domain"."PRJP_DIAGNOSTICS_SERVER_ID" AS VARCHAR2(11)) ELSE N''
END "DiagnosticsServerId", "domain"."PRJP_DOMAIN" "Domain", CASE
WHEN "domain"."PRJP_HOST_POOL_ID" IS NOT NULL
THEN CAST("domain"."PRJP_HOST_POOL_ID" AS VARCHAR2(11)) ELSE N''
END "HostPoolID", "domain"."PRJP_MACHINE_LIMIT" "HostsLimit", "domain"."PRJP_ID" "ID", "domain"."PRJP_PROJECT_NAME" "Name", CASE
WHEN "domain"."PRJP_PROJECT_ID" IS NOT NULL
THEN CAST("domain"."PRJP_PROJECT_ID" AS VARCHAR2(11)) ELSE N''
END "ProjectID", "domain"."PRJP_REC_RES_ENABLED" "RecurrentReservation", "domain"."PRJP_STATE" "State", "domain"."PRJP_TOOLS_OPTIONS" "ToolsOptions", "domain"."PRJP_TOTAL_VUDS_USED" "TotalConsumption", "domain"."PRJP_PROJECT_UID" "UniqueID", "domain"."PRJP_VUDS_LIMIT" "VUDSLimit", "domain"."PRJP_VUGEN_WORKING_MODE" "VugenWorkingMode", "domain"."PRJP_VUSER_LIMIT" "VusersLimit", CASE
WHEN "domain"."PRJP_FUNC_PROLONG_DURATION" IS NOT NULL
THEN CAST("domain"."PRJP_FUNC_PROLONG_DURATION" AS VARCHAR2(11)) ELSE N''
END "TestExtendDuration", CASE
WHEN "domain"."PRJP_MAX_NUM_OF_PROLONGS" IS NOT NULL
THEN CAST("domain"."PRJP_MAX_NUM_OF_PROLONGS" AS VARCHAR2(11)) ELSE N''
END "MaxNumberOfProlongs"
FROM "LAB_PROJECT_PROPERTIES" "domain"
Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12704: character set mismatch
at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.EntityFrameworkCore.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Microsoft.EntityFrameworkCore.Relational.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Oracle.EntityFrameworkCore.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Microsoft.EntityFrameworkCore.Query:Error: An exception occurred while iterating over the results of a query for context type 'OracleErrorExample.Infra.LabDbContext'.
Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12704: character set mismatch
at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12704: character set mismatch
at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in Microsoft.EntityFrameworkCore.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Exception thrown: 'Oracle.ManagedDataAccess.Client.OracleException' in System.Private.CoreLib.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll
The thread 0x3300 has exited with code 0 (0x0).
The program '[4812] iisexpress.exe' has exited with code -1 (0xffffffff).
Answers
-
You can git pull for a more user friendly app
https://github.com/ormarom/examples/tree/master/oracle/OracleError
Use the
https://localhost:44355/api/values/getbad to reproduce.
https://localhost:44355/api/values/getgood to see my workaround
*iis express ip is random
it will create the tables and seed with data on program main.
Make sure you connect with a User with grants to create table and read write.