internal void CheckError(OciHandle errorHandle, int rc)
        {
            // Check the return code and perform the appropriate handling; either
            // throwing the exception or posting a warning message.
            switch ((OCI.RETURNCODE)rc)
            {
            case OCI.RETURNCODE.OCI_ERROR:                              // -1: Bad programming by the customer.
                throw ADP.OracleError(errorHandle, rc, ScratchBuffer);

            case OCI.RETURNCODE.OCI_INVALID_HANDLE:                     // -2: Bad programming on my part.
                throw ADP.InvalidOperation(Res.GetString(Res.ADP_InternalError, rc));

            case OCI.RETURNCODE.OCI_SUCCESS_WITH_INFO:                  // 1: Information Message
                OracleException            infoMessage      = new OracleException(errorHandle, rc, ScratchBuffer);
                OracleInfoMessageEventArgs infoMessageEvent = new OracleInfoMessageEventArgs(infoMessage);
                OnInfoMessage(infoMessageEvent);
                break;

            default:
                if (rc < 0 || rc == (int)OCI.RETURNCODE.OCI_NEED_DATA)
                {
                    throw ADP.Simple(Res.GetString(Res.ADP_UnexpectedReturnCode, rc.ToString(CultureInfo.CurrentCulture)));
                }

                Debug.Assert(false, "Unexpected return code: " + rc);                    // shouldn't be here for any reason.
                break;
            }
        }
Example #2
0
        internal void CheckError(OciErrorHandle errorHandle, int rc)
        {
            switch (((OCI.RETURNCODE)rc))
            {
            case OCI.RETURNCODE.OCI_INVALID_HANDLE:
                throw System.Data.Common.ADP.InvalidOperation(System.Data.OracleClient.Res.GetString("ADP_InternalError", new object[] { rc }));

            case OCI.RETURNCODE.OCI_ERROR:
            case OCI.RETURNCODE.OCI_NO_DATA:
            {
                Exception exception2 = System.Data.Common.ADP.OracleError(errorHandle, rc);
                if ((errorHandle != null) && errorHandle.ConnectionIsBroken)
                {
                    OracleInternalConnection openInternalConnection = this.GetOpenInternalConnection();
                    if (openInternalConnection != null)
                    {
                        openInternalConnection.ConnectionIsBroken();
                    }
                }
                throw exception2;
            }

            case OCI.RETURNCODE.OCI_SUCCESS_WITH_INFO:
            {
                OracleInfoMessageEventArgs infoMessageEvent = new OracleInfoMessageEventArgs(OracleException.CreateException(errorHandle, rc));
                this.OnInfoMessage(infoMessageEvent);
                return;
            }
            }
            if ((rc < 0) || (rc == 0x63))
            {
                throw System.Data.Common.ADP.Simple(System.Data.OracleClient.Res.GetString("ADP_UnexpectedReturnCode", new object[] { rc.ToString(CultureInfo.CurrentCulture) }));
            }
        }
Example #3
0
 private void OnOracleInfoMessage(OracleInfoMessageEventArgs value)
 {
     if (InfoMessage != null)
     {
         InfoMessage(this, value);
     }
 }
        private void OnInfoMessage(OracleInfoMessageEventArgs infoMessageEvent)
        {
            OracleInfoMessageEventHandler handler = (OracleInfoMessageEventHandler)Events[EventInfoMessage];

            if (null != handler)
            {
                handler(this, infoMessageEvent);
            }
        }
Example #5
0
        internal void OnInfoMessage(OracleInfoMessageEventArgs infoMessageEvent)
        {
            OracleInfoMessageEventHandler handler = (OracleInfoMessageEventHandler)base.Events[EventInfoMessage];

            if (handler != null)
            {
                handler(this, infoMessageEvent);
            }
        }
        private void CreateDeferredInfoMessage(OciErrorHandle errorHandle, int rc)
        {
            OracleInfoMessageEventArgs        item = new OracleInfoMessageEventArgs(OracleException.CreateException(errorHandle, rc));
            List <OracleInfoMessageEventArgs> list = this._deferredInfoMessageCollection;

            if (list == null)
            {
                list = this._deferredInfoMessageCollection = new List <OracleInfoMessageEventArgs>();
            }
            list.Add(item);
        }
Example #7
0
		private void OnInfoMessage (OracleInfoMessageEventArgs e)
		{
			if (InfoMessage != null)
				InfoMessage (this, e);
		}
Example #8
0
		internal void CreateInfoMessage (OciErrorInfo info)
		{
			OracleInfoMessageEventArgs a = new OracleInfoMessageEventArgs (info);
			OnInfoMessage (a);
		}
 internal void OnInfoMessage(OracleInfoMessageEventArgs infoMessageEvent)
 {
     OracleInfoMessageEventHandler handler = (OracleInfoMessageEventHandler) base.Events[EventInfoMessage];
     if (handler != null)
     {
         handler(this, infoMessageEvent);
     }
 }
        internal void CheckError(OciErrorHandle errorHandle, int rc)
        {
            switch (((OCI.RETURNCODE) rc))
            {
                case OCI.RETURNCODE.OCI_INVALID_HANDLE:
                    throw System.Data.Common.ADP.InvalidOperation(System.Data.OracleClient.Res.GetString("ADP_InternalError", new object[] { rc }));

                case OCI.RETURNCODE.OCI_ERROR:
                case OCI.RETURNCODE.OCI_NO_DATA:
                {
                    Exception exception2 = System.Data.Common.ADP.OracleError(errorHandle, rc);
                    if ((errorHandle != null) && errorHandle.ConnectionIsBroken)
                    {
                        OracleInternalConnection openInternalConnection = this.GetOpenInternalConnection();
                        if (openInternalConnection != null)
                        {
                            openInternalConnection.ConnectionIsBroken();
                        }
                    }
                    throw exception2;
                }
                case OCI.RETURNCODE.OCI_SUCCESS_WITH_INFO:
                {
                    OracleInfoMessageEventArgs infoMessageEvent = new OracleInfoMessageEventArgs(OracleException.CreateException(errorHandle, rc));
                    this.OnInfoMessage(infoMessageEvent);
                    return;
                }
            }
            if ((rc < 0) || (rc == 0x63))
            {
                throw System.Data.Common.ADP.Simple(System.Data.OracleClient.Res.GetString("ADP_UnexpectedReturnCode", new object[] { rc.ToString(CultureInfo.CurrentCulture) }));
            }
        }
Example #11
0
		static void OnInfoMessage (object sender, OracleInfoMessageEventArgs e) 
		{
			Console.WriteLine("InfoMessage Message: " + e.Message.ToString());
			Console.WriteLine("InfoMessage Code: " + e.Code.ToString());
			Console.WriteLine("InfoMessage Source: " + e.Source.ToString());
		}
Example #12
0
		private void OnOracleInfoMessage (OracleInfoMessageEventArgs value) {
			if (InfoMessage != null) {
				InfoMessage (this, value);
			}
		}
		private void con_InfoMessage(object sender, OracleInfoMessageEventArgs e)
		{
			errorCounter++;
		}
 private void CreateDeferredInfoMessage(OciErrorHandle errorHandle, int rc)
 {
     OracleInfoMessageEventArgs item = new OracleInfoMessageEventArgs(OracleException.CreateException(errorHandle, rc));
     List<OracleInfoMessageEventArgs> list = this._deferredInfoMessageCollection;
     if (list == null)
     {
         list = this._deferredInfoMessageCollection = new List<OracleInfoMessageEventArgs>();
     }
     list.Add(item);
 }