Page 1 of 1

OracleConnection.InfoMessage for multiple ExecuteReader()

Posted: Fri 17 Aug 2012 14:32
by matthiasramp
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

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Posted: Mon 27 Aug 2012 12:21
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Posted: Wed 29 Aug 2012 10:44
by Pinturiccio
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.

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Posted: Mon 10 Sep 2012 08:06
by Pinturiccio
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

Re: OracleConnection.InfoMessage for multiple ExecuteReader()

Posted: Mon 10 Sep 2012 08:52
by matthiasramp
Thank you, Pinturiccio.
The new build 7.2.77 works very good in my test-application. :D