OracleDataReader throws OracleException when using big data tables

OracleDataReader throws OracleException when using big data tables

Postby ax » Wed 04 Apr 2007 06:50

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.)
ax
 
Posts: 2
Joined: Wed 04 Apr 2007 06:32

Postby Alexey » Wed 04 Apr 2007 07:34

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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby ax » Wed 04 Apr 2007 08:42

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.
ax
 
Posts: 2
Joined: Wed 04 Apr 2007 06:32

Postby Alexey » Fri 06 Apr 2007 10:58

Please provide me with the script for creating your table and populating it with your data.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle