"ORA-03113: end-of-file on communication channel" when reading from procedure out parameter cursor

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
pakarjon
Posts: 6
Joined: Tue 05 Mar 2019 13:22

"ORA-03113: end-of-file on communication channel" when reading from procedure out parameter cursor

Post by pakarjon » 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:

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()
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:

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())
                        { 
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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: "ORA-03113: end-of-file on communication channel" when reading from procedure out parameter cursor

Post by Shalex » Mon 18 Mar 2019 19:54

1. Please send us a small complete test project with the corresponding DDL/DML script. Tell us an approximate number of runs required for reproducing the issue.

2. Specify your connection string (mark confidential information with asterisks).

Post Reply