protected OciHandle(OciHandle parentHandle, OCI.HTYPE handleType, OCI.MODE ocimode, HANDLEFLAG handleflags) : this()
        {
            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
            }
            finally
            {
                int num;
                this._handleType   = handleType;
                this._parentHandle = parentHandle;
                this._refCount     = 1;
                switch (handleType)
                {
                case OCI.HTYPE.OCI_DTYPE_TIMESTAMP:
                case OCI.HTYPE.OCI_DTYPE_TIMESTAMP_TZ:
                case OCI.HTYPE.OCI_DTYPE_TIMESTAMP_LTZ:
                case OCI.HTYPE.OCI_DTYPE_INTERVAL_DS:
                case OCI.HTYPE.OCI_DTYPE_FIRST:
                case OCI.HTYPE.OCI_DTYPE_ROWID:
                case OCI.HTYPE.OCI_DTYPE_FILE:
                    num = TracedNativeMethods.OCIDescriptorAlloc(parentHandle.EnvironmentHandle, out this.handle, handleType);
                    if ((num != 0) || (IntPtr.Zero == base.handle))
                    {
                        throw System.Data.Common.ADP.OperationFailed("OCIDescriptorAlloc", num);
                    }
                    break;

                case OCI.HTYPE.OCI_HTYPE_ENV:
                    if ((handleflags & HANDLEFLAG.NLS) != HANDLEFLAG.NLS)
                    {
                        num = TracedNativeMethods.OCIEnvCreate(out this.handle, ocimode);
                        if ((num != 0) || (IntPtr.Zero == base.handle))
                        {
                            throw System.Data.Common.ADP.OperationFailed("OCIEnvCreate", num);
                        }
                    }
                    else
                    {
                        num = TracedNativeMethods.OCIEnvNlsCreate(out this.handle, ocimode, 0, 0);
                        if ((num != 0) || (IntPtr.Zero == base.handle))
                        {
                            throw System.Data.Common.ADP.OperationFailed("OCIEnvNlsCreate", num);
                        }
                    }
                    break;

                case OCI.HTYPE.OCI_HTYPE_ERROR:
                case OCI.HTYPE.OCI_HTYPE_SVCCTX:
                case OCI.HTYPE.OCI_HTYPE_STMT:
                case OCI.HTYPE.OCI_HTYPE_SERVER:
                case OCI.HTYPE.OCI_HTYPE_SESSION:
                    num = TracedNativeMethods.OCIHandleAlloc(parentHandle.EnvironmentHandle, out this.handle, handleType);
                    if ((num != 0) || (IntPtr.Zero == base.handle))
                    {
                        throw System.Data.Common.ADP.OperationFailed("OCIHandleAlloc", num);
                    }
                    break;
                }
                if (parentHandle != null)
                {
                    parentHandle.AddRef();
                    this._isUnicode = parentHandle.IsUnicode;
                }
                else
                {
                    this._isUnicode = (handleflags & HANDLEFLAG.UNICODE) == HANDLEFLAG.UNICODE;
                }
            }
        }