[Mono-bugs] [Bug 573188] OracleDataAdapter fills only the first table of the resulting dataSet when invoking a stored procedure with more than one cursor ref out parameters.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 25 14:15:04 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=573188

http://bugzilla.novell.com/show_bug.cgi?id=573188#c1


--- Comment #1 from Jeffrey Alvarez <kuritsu at gmail.com> 2010-01-25 19:15:03 UTC ---
I think I found the error sources:

1st: The Read method in System.Data.OracleClient.OracleDataReader has the
following code:

        public override bool Read ()
        {
            ValidateState ();

            if (hasRows) {
                bool retval = statement.Fetch ();
                hasRows = retval;
                return retval;
            }
            return false;
        }

and NextResult is as follows:

                public override bool NextResult ()
        {
            ValidateState ();

            if (statement == null)
                return false;

            statement.Dispose ();
            statement = null;

            statement = command.GetNextResult ();

            if (statement == null)
                return false;

            return true; 
        }

As you can see, the hasRows field is not set to true in NextResult, in a way
that when Read is invoked, the Fetch is performed and hasRows updated.

There was also an issue related to the GetSchemaTable method. This method has
the following statement:

if (schemaTable.Rows != null && schemaTable.Rows.Count > 0)
   return schemaTable;

so, if the schema table was created for the first table the first time, then
after you invoke NextResult, the schema table isn't populated again, so you
should include some coding for reseting the schema table. This is the result of
the changed NextResult method:

                public override    bool NextResult ()
        {
            ValidateState ();

            if (statement == null)
                return false;

            statement.Dispose ();
            statement = null;

            hasRows = true; // !New

            schemaTable.Rows.Clear(); // !New

            statement = command.GetNextResult ();

            if (statement == null)
                return false;

            return true; 
        }

Please anyone notice this so you can update the Mono code repository.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list