"ORA-03113: end-of-file on communication channel" when reading from procedure out parameter cursor
Posted: Fri 15 Mar 2019 13:52
I have procedures that return SYS_REFCURSOR cursor as an out parameter to be handled in .NET code. However occasionally reading from cursor fails with following stack:
Earlier I had multiple OUT cursors in those procedures but the problem was so bad that I refactored my procedures to return objects with nested tables as a result set. It seems that it helps to reduce dramatically occurrence of ORA-03113 exceptions; however not entirely.
I have tried to follow instructions of https://www.devart.com/dotconnect/oracl ... rsors.html
by filling datasets using OracleDataAdapter and am currently reading data directly with OracleDataReader. Both ways result in same exception.
Here's how I initialize the procedure command:
I don't know if connection handling has something to do with the problem but should I use some kind of connection pool or something with oracle connections? Could the problem have something to do with connection handling?
Product versions in use:
Microsoft.EntityFrameworkCore 2.2.3
Devart.Data.Oracle (9.6.696)
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
Code: Select all
Error Message:
Devart.Data.Oracle.OracleException : ORA-03113: end-of-file on communication channel
Stack Trace:
at . (Int32 )
at Devart.Data.Oracle.OracleDataReader.Read()
I have tried to follow instructions of https://www.devart.com/dotconnect/oracl ... rsors.html
by filling datasets using OracleDataAdapter and am currently reading data directly with OracleDataReader. Both ways result in same exception.
Here's how I initialize the procedure command:
Code: Select all
await connection.OpenAsync().ConfigureAwait(false);
OracleParameter oResults = new OracleParameter()
{
ParameterName = "oResults",
OracleDbType = OracleDbType.Cursor,
Direction = ParameterDirection.Output,
};
parameters.AddRange(filterParameters);
parameters.Add(oResults);
using (var command = new OracleCommand(
procedureName,
connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddRange(parameters.ToArray());
command.ParameterCheck = false;
await command.ExecuteNonQueryAsync().ConfigureAwait(false);
if (oResults.Value != null && oResults.Value is OracleCursor elementsCursor)
{
var reader = elementsCursor.GetDataReader();
while (reader.Read())
{
Product versions in use:
Microsoft.EntityFrameworkCore 2.2.3
Devart.Data.Oracle (9.6.696)
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production