[Mono-dev] Bug 486705 Update / Fix?

Shao Jiaxing shaojiaxing at gmail.com
Fri Mar 20 08:21:29 EDT 2009

I had fix this problem by myself. I just add one line code "hasRows = true;" 
before NextResult() "return true;". Because when use DataReader.Read() read
all rows from first cursor, the hasRows is set false. Then call NextResult()
not set hasRows = true and DataReader.Read() is check hasRows first, so the
bug come out. 
Now working with multiple out REF cursor was prefect in my project. I don't
know whether this fix can solve the bug without causing other problem, but
it works.

Thracx wrote:
> <P>I might have found the source of 
> https://bugzilla.novell.com/show_bug.cgi?id=486705 Bug 486705 .  For
> whatever reason, I am unable to create a 
> https://secure-www.novell.com/selfreg/jsp/createAccount.jsp Novell account 
> so if someone could post this info to that Bug on my behalf, it would be
> much appreciated.
> </P><P>
> <code>NextResult()</code>  of <code>OracleDataReader.cs</code> (Line 848)
> has a <code>//FIXME:  get next result</code> comment in it that simply
> returns false - this should be changed to throw a
> <code>NotImplementedException</code>.  Bug 486705 is simply that Mono does
> not currently support multiple result sets (ref cursors) but the lack of
> exceptions does not tell the user this.  I think there are quite a few of
> these comments in the source, most if not all of them should be changed to
> <code>NotImplementedExceptions</code>.
> </P><P>
> We should also  http://www.mono-project.com/Oracle document this , but I
> don't seem to have the ability to change that wiki page.
> </P><P>
> <small><P>I wrote this a while back before I had the latest source code,
> but I thought I should just post it anyway for others to find when
> searching.
> </P><P>
> ExecuteReader(...) of System.Data.OracleClient.OracleCommand.cs (Line 580)
> does a for-loop over p (0 thru Parameters.Count), yet the loop itself does
> not use the loop-invariant (p) - instead it always uses '0' (i.e.
> Parameters[0] on Line 581).  The code in OracleCommand.cs, method
> GetNextResults()  (Line 661) has the proper loop so my understanding is
> when Mono first gets the OracleDataReader/RefCursor, it should only get
> the first cursor.  Later, command.NextResult() will be called by the user
> which will call GetNextResults() and properly get the next cursor.
> </P><P>
> This would explain to my why ExecuteReader(...) never worked for me, as my
> OUT cursors were never the first parameter in the Stored Procedure.  I've
> had to save a reference to the OracleParameter when I declare it and then
> use param.Value after a call to ExecuteNonQuery(...) (which does work fine
> for multiple cursor out parameters).  I think this is a new bug, as I
> wasn't able to find anything about it when searching (other than the
> possibly related Bug 486705).
> </P><P>
> This might explain Bug 486705 to me - Shao Jiaxing was able to get his
> first cursor out but couldn't get any data from any other cursors if the
> first parameter wasn't a cursor.
> </P><P>
> In the least, I would like to add some comments/documentation to explain
> what is happening here - does anyone know why I can't create a Novell
> account?  It seems to time out.
> </P>
> </small>

View this message in context: http://www.nabble.com/Bug-486705-Update---Fix--tp22604148p22619230.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

More information about the Mono-devel-list mailing list