oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
408 stars 190 forks source link

Help with OracleDataReader.Read null reference #311

Closed deniscpereira closed 9 months ago

deniscpereira commented 9 months ago

I have a query that uses dapper with multimap.

It is intermittent when it works and when it doesn't.

I perform the first execution and with its data I perform several insertions into other tables, but in the second execution I get the following error

System.NullReferenceException: Object reference not set to an instance of an object.
   at Oracle.ManagedDataAccess.Client.OracleDataReader.Read()
   at Dapper.SqlMapper.MultiMapImpl[TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn](IDbConnection cnn, CommandDefinition command, Delegate map, String splitOn, IDataReader reader, Identity identity, Boolean finalize)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1467
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.MultiMapAsync[TFirst,TSecond,TThird,TFourth,TFifth,TSixth,TSeventh,TReturn](IDbConnection cnn, CommandDefinition command, Delegate map, String splitOn) in /_/Dapper/SqlMapper.Async.cs:line 915     

Infos

alexkeh commented 9 months ago

Can you turn on ODP.NET tracing with TraceLevel set to 7 and share the trace?

alexkeh commented 9 months ago

I will reopen the issue once the trace is provided.