Fixes 19752 -
authorNeale Ferguson <neale@sinenomine.net>
Fri, 12 Sep 2014 15:19:05 +0000 (11:19 -0400)
committerNeale Ferguson <neale@sinenomine.net>
Fri, 12 Sep 2014 15:25:57 +0000 (11:25 -0400)
commit3f740f3d94c00f0edd4f0bb317bd3133ac279da0
treec541ee5b396f68426ab2169156348b5128d83c43
parent300876b229fb73f6b6e13bda3081318b43c72971
Fixes 19752 -

Users have been complaining about strange errors arising when using the OracleClient classes.
I have tracked it down to the OciDefineHandle and OciDefineByPos calls, and OracleParameter
handling of amanged objects by unmanaged code. Currently two of the parameters passed to the
above OCI  call are short variables. They are passed as "ref" fields as Oracle uses their
address to put size and indicator data once the data is fetched. However, being defined as
short means that they are eligible for being moved during garbage collection. Thus if that
field is moved between the OciDefineByPos call and the fetch of the data then what Oracle is
pointing to may no longer be variable. I'm thinking it may be better to define these fields as
IntPtr and allocate them and retrieve their values via Marshal.ReadInt16. As for OracleParameter,
it uses a managed object "indicator" that is also used in a similar way. This reference is replaced
by a IntPtr and a get/set method to access the contents.
mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs
mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs