Page 1 of 1

OracleDataReader throws OracleException when using big data tables

Posted: Wed 04 Apr 2007 06:50
by ax
I need to call stored procs that return a cursor which is then used for an OracleDataReader sort of like this:

Code: Select all

OracleCommand cmd = new OracleCommand();
            string cmdText = "begin open :cur for select * from myTable; end;";
            cmd.CommandText = cmdText;            
            cmd.Connection = connection;
            cmd.Parameters.Add( "cur", OracleDbType.Cursor ).Direction = System.Data.ParameterDirection.ReturnValue;
            cmd.ExecuteNonQuery();
            OracleCursor oraCursor = (OracleCursor)cmd.Parameters["cur"].Value;
            OracleDataReader dr = oraCursor.GetDataReader();

 for ( int i = 0; i < 10000; i++ )
            {
                dr.Read();
                for ( int j = 0; j < dr.FieldCount; j++ )
                {
                    Console.Write( dr[j].ToString() + ";" );
                }
                Console.WriteLine();

            }
 


When I use this Datareader to get the data it works with a table that doesn't contain too many entries. When I reach something like the 2540th line of the data table, however, I get an OracleException saying "OCI invalid handle".

What's wrong? (The same thing works fine with other data providers.)

Posted: Wed 04 Apr 2007 07:34
by Alexey
We cannot reproduce the problem having even much more records.
Please specify your Oracle server/client versions, version of OraDirect .NET you are using and your table definition.

Posted: Wed 04 Apr 2007 08:42
by ax
We're currently testing the trial version of OraDirect .NET 3.55 for .NET Framework 2.0.

Oracle client: Oracle SQL *Plus Version 9.2.0.1.0
Server: Oracle8i Release 8.1.5.0.0 - Production
(at least so I have been told)

The table contains nothing special, just some numbers and varchar2.

Strange: like I said, this error doesn't occur with the other data providers we're testing under the same circumstances.

Posted: Fri 06 Apr 2007 10:58
by Alexey
Please provide me with the script for creating your table and populating it with your data.