Attempted to read or write protected memory in Oracle 11g with ODP.NET

While constructing my OracleCommand object and adding parameters...

I found that changing from:

select.Parameters.Add("Result", OracleDbType.RefCursor);

To:

select.Parameters.Add("Result", OracleDbType.RefCursor, ParameterDirection.Output);

Eliminated this problem for me on the 11.2.0.2 client.


This is a bug. The 11.1 and 11.2 providers had this issue. The only way to get around this is to install the 11.2.0.2 client and then apply patch 6.