Package org.apache.derby.iapi.error

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


                // not many read I/O errors have been reported.
        if (io_retry_count > 4)
                {
          // page cannot be physically read
 
          StandardException se =
            StandardException.newException(
                   SQLState.FILE_READ_PAGE_EXCEPTION,
                   ioe, newIdentity, new Integer(pagesize));

           
View Full Code Here


    FileContainer myContainer =
            (FileContainer) containerCache.find(identity.getContainerId());

    if (myContainer == null)
    {
      StandardException nested =
        StandardException.newException(
          SQLState.DATA_CONTAINER_VANISHED,
          identity.getContainerId());
      throw dataFactory.markCorrupt(
        StandardException.newException(
View Full Code Here

      throw NO_MEM;
    }
    catch (Throwable t) {
            if (t instanceof StandardException)
            {
                StandardException se = (StandardException) t;
                if (se.getSeverity() < ExceptionSeverity.SESSION_SEVERITY)
                    se.setSeverity(ExceptionSeverity.SESSION_SEVERITY);
            }
      tr.cleanupOnError(t);
      throw handleException(t);
    } finally {
      restoreContextStack();
View Full Code Here

    {
        long   maxLength = Integer.MAX_VALUE;
        long   length = _clobValue.length();
        if ( length > Integer.MAX_VALUE )
        {
            StandardException se = StandardException.newException
                ( SQLState.BLOB_TOO_LARGE_FOR_CLIENT, Long.toString( length ), Long.toString( maxLength ) );

            throw new SQLException( se.getMessage() );
        }

        return (int) length;
    }
View Full Code Here

            // stop slave replication mode.
            return;
        }
       
        if (!inReplicationSlaveMode) {
            StandardException se = StandardException.
                newException(SQLState.REPLICATION_NOT_IN_SLAVE_MODE);
            throw PublicAPI.wrapStandardException(se);
        }

        // stop slave without using force, meaning that this method
View Full Code Here

     *
     * @exception SQLException Always thrown because BasicDatabase cannot
     * be in replication slave mode
     */
    public void stopReplicationSlave() throws SQLException {
        StandardException se = StandardException.
            newException(SQLState.REPLICATION_NOT_IN_SLAVE_MODE);
        throw PublicAPI.wrapStandardException(se);
    }
View Full Code Here

  Database getDatabase() {
    return  database;
  }

  StandardException shutdownDatabaseException() {
    StandardException se = StandardException.newException(SQLState.SHUTDOWN_DATABASE, getDBName());
    se.setReport(StandardException.REPORT_NEVER);
    return se;
  }
View Full Code Here

      }

      boolean checkForShutdown = false;
      if (thrownException instanceof StandardException)
      {
        StandardException se = (StandardException) thrownException;
        int severity = se.getSeverity();
        if (severity <= ExceptionSeverity.STATEMENT_SEVERITY)
        {
          /*
          ** If autocommit is on, then do a rollback
          ** to release locks if requested.  We did a stmt
          ** rollback in the cleanupOnError above, but we still
          ** may hold locks from the stmt.
          */
          if (autoCommit && rollbackOnAutoCommit)
          {
            se.setSeverity(ExceptionSeverity.TRANSACTION_SEVERITY);
          }
        } else if (SQLState.CONN_INTERRUPT.equals(se.getMessageId())) {
          // an interrupt closed the connection.
          checkForShutdown = true;
        }
      }
      // if cm is null, we don't have a connection context left,
View Full Code Here

            return (SQLException) thrownException;
    }

        if (thrownException instanceof StandardException) {

      StandardException se = (StandardException) thrownException;

            if (se.getCause() == null) {
                // se is a single, unchained exception. Just convert it to an
                // SQLException.
                return Util.generateCsSQLException(se);
            }

            // se contains a non-empty exception chain. We want to put all of
            // the exceptions (including Java exceptions) in the next-exception
            // chain. Therefore, call wrapInSQLException() recursively to
            // convert the cause chain into a chain of SQLExceptions.
            return Util.seeNextException(se.getMessageId(),
                        se.getArguments(), wrapInSQLException(se.getCause()));
        }

        // thrownException is a Java exception
        return Util.javaException(thrownException);
  }
View Full Code Here

        {
            // if the test debug flag is set, throw an
            // exception to simulate error cases.
            if (SanityManager.DEBUG_ON(debugFlag))
            {
               StandardException se = StandardException.newException(
                                      (reEncrypt ? SQLState.DATABASE_REENCRYPTION_FAILED :
                                      SQLState.DATABASE_ENCRYPTION_FAILED),
                                      debugFlag);
               markCorrupt(se);
               throw se;
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.