Package org.apache.derby.iapi.error

Examples of org.apache.derby.iapi.error.StandardException


  private void dropAllDeclaredGlobalTempTables() throws StandardException {
    if (allDeclaredGlobalTempTables == null)
      return;
   
    DependencyManager dm = getDataDictionary().getDependencyManager();
    StandardException topLevelStandardException = null;

    //collect all the exceptions we might receive while dropping the temporary tables and throw them as one chained exception at the end.
    for (int i = 0; i < allDeclaredGlobalTempTables.size(); i++) {
      try {
        TempTableInfo tempTableInfo = (TempTableInfo)allDeclaredGlobalTempTables.get(i);
View Full Code Here


      if (affectedCols != null)
        subsetCols = new FormatableBitSet(affectedCols.getLength());
    }

    {
      StandardException noInvalidate = null;
      // We cannot use an iterator here as the invalidations can remove
      // entries from this list.
      for (int ei = list.size() - 1; ei >= 0; ei--)
      {
        if (ei >= list.size())
View Full Code Here

        // An empty properties object is meaningless, but allowed
        if (properties == null || properties.isEmpty()) {
            return;
        }

        StandardException se =
            StandardException.newException
            (SQLState.PROPERTY_UNSUPPORTED_CHANGE,
             fp.getFirstKey(),
             fp.getFirstValue());
        throw new SQLClientInfoException(se.getMessage(),
                                         se.getSQLState(), fp.getProperties());
    }
View Full Code Here

      }

    boolean throwAway = false;

    if (error instanceof StandardException) {
      StandardException se = (StandardException) error;

      if (abortAll) {
        // any error aborts an internal/nested xact and its transaction

        if (se.getSeverity() < ExceptionSeverity.TRANSACTION_SEVERITY)
                {
          throw StandardException.newException(
                        SQLState.XACT_INTERNAL_TRANSACTION_EXCEPTION, error);
                }

        throwAway = true;


      } else {

        // If the severity is lower than a transaction error then do nothing.
        if (se.getSeverity() < ExceptionSeverity.TRANSACTION_SEVERITY)
                {
          return;
                }
                

        // If the session is going to disappear then we want to close this
        // transaction, not just abort it.
        if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY)
          throwAway = true;
      }
    } else {
      // some java* error, throw away the transaction.
      throwAway = true;
    }

    try {

      if (xact != null) {
        // abort the transaction
        xact.abort();
      }

    } catch (StandardException se) {
      // if we get an error during abort then shut the system down
      throwAway = true;

      // if the system was being shut down anyway, do nothing
      if ((se.getSeverity() <= ExceptionSeverity.SESSION_SEVERITY) &&
        (se.getSeverity() >= ((StandardException) error).getSeverity())) {

        throw factory.markCorrupt(
                    StandardException.newException(
                        SQLState.XACT_ABORT_EXCEPTION, se));
      }
View Full Code Here

    }
  }

  private void checkObserverException() throws StandardException {
    if (observerException != null) {
      StandardException se = observerException;
      observerException = null;
      throw se;
    }
  }
View Full Code Here

               */
              secondRow = source.getNextRowCore();
              if (secondRow != null)
              {
                close();
                StandardException se = StandardException.newException(SQLState.LANG_SCALAR_SUBQUERY_CARDINALITY_VIOLATION);
                throw se;
              }
            }
            result = candidateRow;
            break;

          case UNIQUE_CARDINALITY_CHECK:
            candidateRow = candidateRow.getClone();
            secondRow = source.getNextRowCore();
            DataValueDescriptor orderable1 = candidateRow.getColumn(1);
            while (secondRow != null)
            {
              DataValueDescriptor orderable2 = secondRow.getColumn(1);
              if (! (orderable1.compare(DataValueDescriptor.ORDER_OP_EQUALS, orderable2, true, true)))
              {
                close();
                StandardException se = StandardException.newException(SQLState.LANG_SCALAR_SUBQUERY_CARDINALITY_VIOLATION);
                throw se;
              }
              secondRow = source.getNextRowCore();
            }
            result = candidateRow;
View Full Code Here

    setInUse(false);
    resetContext();

    if (error instanceof StandardException) {

      StandardException se = (StandardException) error;
      // if something went wrong with the compile,
      // we need to mark the statement invalid.
      // REVISIT: do we want instead to remove it,
      // so the cache doesn't get full of garbage input
      // that won't even parse?
           
            int severity = se.getSeverity();

      if (severity < ExceptionSeverity.SYSTEM_SEVERITY)
      {
        if (currentDependent != null)
        {
View Full Code Here

            {
                SanityManager.DEBUG_PRINT(debug_deadlock, debug_deadlock);
                SanityManager.DEBUG_CLEAR(debug_deadlock);

                // Simulate a deadlock error.
                StandardException se =
                    StandardException.newException(
                        SQLState.DEADLOCK, "fake deadlock", "fake victim");

        se.setReport(StandardException.REPORT_ALWAYS);
        throw se;
            }
        }

        return(latch_released);
View Full Code Here

    boolean destroy = false;

    if (abortAll == false && (error instanceof StandardException))
    {
      StandardException se = (StandardException) error;

      // If the severity is lower than a transaction error then do nothing.
      if (se.getSeverity() < ExceptionSeverity.TRANSACTION_SEVERITY)
        return;

      // If the session is going to disappear then we want to destroy this
      // transaction, not just abort it.
      if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY)
        destroy = true;
    }
    else
    {
      // abortAll is true or some java* error, throw away the
View Full Code Here

  private void dropAllDeclaredGlobalTempTables() throws StandardException {
    if (allDeclaredGlobalTempTables == null)
      return;
   
    DependencyManager dm = getDataDictionary().getDependencyManager();
    StandardException topLevelStandardException = null;

    //collect all the exceptions we might receive while dropping the temporary tables and throw them as one chained exception at the end.
    for (int i = 0; i < allDeclaredGlobalTempTables.size(); i++) {
      try {
        TempTableInfo tempTableInfo = (TempTableInfo)allDeclaredGlobalTempTables.get(i);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.error.StandardException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.