ORA-01427 Exception not being thrown

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
johndd
Posts: 2
Joined: Thu 30 Apr 2015 16:51

ORA-01427 Exception not being thrown

Post by johndd » Fri 08 Jul 2016 19:40

I have a .NET application which runs a query against an Oracle view. The View has a subquery in the select statement and on occasion that subquery returns multiple rows. My issue is that the ORA-01427 Exception isn't being thrown by the Devart OracleDataReader. Instead the application hangs until the Command Timeout is reached at which time I get an "ORA-03113: end-of-file on communication channel". I would expect instead the actual error message "ORA-01427: single-row subquery returns more than one row".

I have noticed that if I change the FetchSize on the command object to 1 then I do indeed get the error, but I should be able to set the FetchSize to 200 and still get the ORA-01427 error.

If I use the Oracle Data Provider for .NET from oracle it does throw the ORA-01427 error.

Code: Select all

            OracleConnection con = null;
            OracleCommand cmd = null;
            OracleDataReader rdr = null;
            int counter = 0;
            try
            {
                con = new OracleConnection(connectionString);
                con.Open();
                cmd = new OracleCommand(query, con);
                cmd.CommandTimeout = 20;
                rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Console.WriteLine(++counter);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

johndd
Posts: 2
Joined: Thu 30 Apr 2015 16:51

Re: ORA-01427 Exception not being thrown

Post by johndd » Mon 11 Jul 2016 16:08

I forgot to start I'm running Devart dotConnect Oracle version 8.5.558. I tried upgrading to 9.1.55 but experienced the same problem of not receiving the exception.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: ORA-01427 Exception not being thrown

Post by Pinturiccio » Wed 13 Jul 2016 15:02

We could not reproduce the issue. Please send us a complete test sample with your connection string (roughly, without credentials) and query and with the corresponding DDL/DML scripts, which reproduces the issue.

Post Reply