Closed MatrixWPY closed 4 months ago
Can you turn on ODP.NET tracing and upload the trace file? You can do so by adding the following two lines ahead of opening your first connection.
OracleConfiguration.TraceFileLocation = @"C:\traces";
OracleConfiguration.TraceLevel = 7;
It will be easier to initially triage the issue based on that. If this app worked before, what changes occurred between the last time it worked and now?
Thanks for response :) Now I have added the configure to record trace file, but it comes out another similar exception.
OracleConfiguration.TraceFileLocation = @"D:\traces";
OracleConfiguration.TraceLevel = 7;
var res = _dbConnection.Query<QueryProductV5RP>(
"SP_QUERYPRODUCTV5",
dynamicParam,
commandType: CommandType.StoredProcedure
);
Object reference not set to an instance of an object.
at Oracle.ManagedDataAccess.Types.OracleUdt.GetAllReferencedAssemblies()
in Oracle.ManagedDataAccess.Types\OracleUdt.cs:line 739
It seems like "Assembly.Load()" from "Anonymously Hosted DynamicMethods Assembly" would cause "assembly2" = null. The strangest thing is even this exception happened, my code still works fine (query condition with UDT parameter). And It only happen on the first query (UDT parameter), the following query wouldn't cause this exception again.
Upload the trace file, thanks :) TraceFile.zip
@alexkeh any suggestion? I would like to know is there any configuration missing or it is a bug for current version? Hope to get any feedback soon :)
@MatrixWPY The trace doesn't provide enough information to identify the root cause unfortunately. Something isn't being loaded, but it's not clear what it is with the current trace info. Does this exception message occur at runtime without a debugger?
The next step would be getting you a diagnostic drop with enhanced tracing to see how the object reference problem arises. Open an Oracle Support service request and request the support analyst to contact me within Oracle. I'll work with support to provide you an enhanced trace to run.
Thanks for response :) Recently I had deployed my project on IIS, and everything works fine (no error log). Looks like the exception only happened on debug mode.
Environment
UDT in DB
Stored-Procedure
UDT in Code
OracleDynamicParameters
Dapper call Stored-Procedure
Exception