[Mono-dev] OracleClient.Oci and GC

Neale Ferguson NealeFerguson at verizon.net
Thu Aug 21 22:58:19 UTC 2014


I've been looking at OciDefineHandle and the OciDefineByPos call it uses in particular. Currently two of the parameters passed to this 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. I'm currently testing these changes and so far I'm not getting the failures I had been encountering. If this is a valid analysis then the OciBindxxxx calls will also need attention as it uses a ref indp parameter as well - these appear to be used in OracleParameter.cs. 

Neale


More information about the Mono-devel-list mailing list