Oracle, ODP.NET, RefCursors, Enterprise Library and Readers
November 25, 2008
We have been chasing a nasty bug for a few days now. It actually has to do with all the technologies above.
The thing is that we have a Oracle stored procedure that returns a RefCursor. The stored procedures is actually just doing a simple SELECT from our system value tables. We are using Enterprise Library to call the stored procedure. We are using the command ExecuteReader. And here the funny business starts.
For starters the stored procedure declare an OUT RefCursor and so we are adding a RefCursor-parameter to our Oracle store procedure command object. But when our ExecuteReader is ran the command is NULL (DBNull).
Furthermore we ran into some connection problems since we had loads of connections hanging in the database, after running our unit tests (that made many calls to said stored procedure).
After a lot of researching...