Ejemplo n.º 1
0
        public void Commit()
        {
            int status = 0;

            AttachToServiceContext();
            try
            {
                status = OciCalls.OCITransCommit(Service, ErrorHandle, 0);

                if (status != 0)
                {
                    OciErrorInfo info = ErrorHandle.HandleError();
                    throw new OracleException(info.ErrorCode, info.ErrorMessage);
                }
            }
            finally
            {
                DetachFromServiceContext();
            }
        }
Ejemplo n.º 2
0
        protected override void FreeHandle()
        {
            // Parameter handles are disposed implicitely
            if (HandleType >= OciHandleType.LobLocator)
            {
                switch (HandleType)
                {
                case OciHandleType.Parameter:
                case OciHandleType.TimeStamp:
                    break;

                default:
                    if (Handle != IntPtr.Zero)
                    {
                        OciCalls.OCIDescriptorFree(this, HandleType);
                        SetHandle(IntPtr.Zero);
                    }
                    break;
                }
            }
        }
        public long GetLength(bool binary)
        {
            int  status = 0;
            uint output;

            status = OciCalls.OCILobGetLength(Service,
                                              ErrorHandle,
                                              this,
                                              out output);
            if (status != 0)
            {
                OciErrorInfo info = ErrorHandle.HandleError();
                throw new OracleException(info.ErrorCode, info.ErrorMessage);
            }

            if (!binary)
            {
                output *= 2;
            }

            return((long)output);
        }
        internal string GetOracleVersion()
        {
            byte[] buffer  = new Byte[256];
            uint   bufflen = (uint)buffer.Length;

            IntPtr sh = oci.ServiceContext;
            IntPtr eh = oci.ErrorHandle;

            OciCalls.OCIServerVersion(sh, eh, ref buffer, bufflen, OciHandleType.Service);

            // Get length of returned string
            int    rsize = 0;
            IntPtr env   = oci.Environment;

            OciCalls.OCICharSetToUnicode(env, null, buffer, out rsize);

            // Get string
            StringBuilder ret = new StringBuilder(rsize);

            OciCalls.OCICharSetToUnicode(env, ret, buffer, out rsize);

            return(ret.ToString());
        }