Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 718 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 299 [details]
The finished OracleParameter.cs file
When using Oracle functions/procedures/packages, passing a REF CURSOR as an OUT parameter is an extremely important capability. In Mono 2.10.5, this feature is broken on Mac OS X. Any time the code attempts to specify the OracleType of an OracleParameter object to be OracleType.Cursor, an error is thrown.
To fix this bug I just had to move one line of code, so it should be fairly easy to test and deploy.
I'm looking at source TarBall 2.10.5
If you look at line 1122, you'll see:
Type valType = value.GetType ();
Not sure what this is supposed to be doing, but when 'value' is 'OracleType.Cursor' it throws:
SystemError: Object reference not set to an instance of an object
To fix this, all I did was move this line 1132 so that the use of valType is immediately after.
My final code looks like this:
Type valType = value.GetType ();
if (valType.FullName == "System.Guid")
dbType = DbType.Guid;
dbType = DbType.Binary;
ociType = OciDataType.Raw;
After recompiling and running 'make install', my ref cursors worked fine.
Please conduct some standard tests and if acceptable, please update the trunk. I'll be proud to develop our application in Mono on Mac and then deploy to our users in Windows!
The error means that "value" would be null, I am not sure that this is a OracleType.Cursor.
Would you mind providing us with a test case that shows the problem?
I tried adding a test case via the 'Create Test Case' link, but I don't think I've got access.
The best test case is from the Mono Website:
C# Example 5 - Returning a REF CURSOR from an Oracle stored procedure via an OracleDataReader from an out parameter
Step 1. Install Oracle Database Server in the usual way. I am using Oracle 11g running on Fedora 13 (on a VM)
Step 2. Install the Oracle Instant Client for MacOSX. You need to use the 32 bit client, even though you may have an OS which is 64 bit. Download from the Oracle Website and unzip:
Step 3. You'll probably need to tweak the connection settings in Test.cs so it points to your Oracle DB. For example:
string connectionString =
"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.101)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=macoracl)));" +
"User ID=scott;" +
Step 4. Compile the Test.cs into Test.exe
mcs Test.cs /r:System.Data.dll /r:System.Data.OracleClient.dll
Step 5. Set the environment variable to point to where you unzipped the Oracle client.
You may need to clone this file:
cp libclntsh.dylib.10.1 libclntsh.dylib
Step 6. You can now run Test.exe