OracleConnection.InfoMessage for multiple ExecuteReader()

OracleConnection.InfoMessage for multiple ExecuteReader()

Postby matthiasramp » Fri 17 Aug 2012 14:32

Hi Devart-Team.

I found a strange behaviour at the OracleConnection.InfoMessage-Event.
Let's take a look a this piece of code:
Code: Select all
    Private Sub ExecuteSimpleButton_Click(sender As System.Object, e As System.EventArgs) Handles ExecuteSimpleButton.Click

        MyOracleConnection.Open()

        Try
            Dim cm As New Devart.Data.Oracle.OracleCommand
            cm.Connection = MyOracleConnection
            cm.CommandText = "SELECT sysdate FROM dual"

            Dim r1 As Devart.Data.Oracle.OracleDataReader = cm.ExecuteReader
            Dim r2 As Devart.Data.Oracle.OracleDataReader = cm.ExecuteReader

        Finally
            MyOracleConnection.Close()
        End Try

    End Sub

    Private Sub MyOracleConnection_InfoMessage(sender As Object, e As Devart.Data.Oracle.OracleInfoMessageEventArgs) Handles MyOracleConnection.InfoMessage
        MessageBox.Show(e.Message)
    End Sub

-> Open connection, create command and ExecuteReader() twice.

When executing the 2nd cm.ExecuteReader a InfoMessage-Event for the OracleConnection is generated, with e.Message = "ORA-01403: no data found".
This message is not correct. It makes no difference if you do r1.Read before executing the 2nd ExecuteReader. Furthermore, it does not depend on the commandtext and if it really returns data, e.g.: "Select sysdate from dual where 1=2" will result in the same behaviour (InfoMessage-Event raised at the 2nd ExecuteReader).
Only when altering the CommandText between the 2 ExecuteReader-statements, the InfoMessage is not raised.

Is it our mistake to call ExecuteReader twice? Is the ORA-01403 message generated from Oracle or from Devart?

Regards,
Matthias
matthiasramp
 
Posts: 12
Joined: Fri 22 Jan 2010 15:39

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Postby Pinturiccio » Mon 27 Aug 2012 12:21

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.
Pinturiccio
Devart Team
 
Posts: 1928
Joined: Wed 02 Nov 2011 09:44

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Postby Pinturiccio » Wed 29 Aug 2012 10:44

We have fixed the bug with getting 'ORA-01403' under recurrent execution of a select query. We will post here when the corresponding build of dotConnect for Oracle is available for download.

As a workaround, you can set the oracleCommand FetchSize property to the number of rows which will be returned by select query.
Pinturiccio
Devart Team
 
Posts: 1928
Joined: Wed 02 Nov 2011 09:44

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Postby Pinturiccio » Mon 10 Sep 2012 08:06

The new build of dotConnect for Oracle 7.2.77 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=24845
Pinturiccio
Devart Team
 
Posts: 1928
Joined: Wed 02 Nov 2011 09:44

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Postby matthiasramp » Mon 10 Sep 2012 08:52

Thank you, Pinturiccio.
The new build 7.2.77 works very good in my test-application. :D
matthiasramp
 
Posts: 12
Joined: Fri 22 Jan 2010 15:39


Return to dotConnect for Oracle