Package org.apache.derby.iapi.error

Examples of org.apache.derby.iapi.error.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++)
        {
View Full Code Here


                // shutdown/drop as clean as possible.
                sleep(500L);
                Monitor.removePersistentService(dbName);
                // Generate the drop database exception here, as this is the
                // only place it will be thrown.
                StandardException se = StandardException.newException(
                    SQLState.DROP_DATABASE, dbName);
                se.setReport(StandardException.REPORT_NEVER);
                throw se;
            }

      // Raise a warning in sqlAuthorization mode if authentication is not ON
      if (usingNoneAuth && getLanguageConnection().usesSqlAuthorization())
        addWarning(SQLWarningFactory.newSQLWarning(SQLState.SQL_AUTHORIZATION_WITH_NO_AUTHENTICATION));
            InterruptStatus.restoreIntrFlagIfSeen(getLanguageConnection());
    }
        catch (OutOfMemoryError noMemory)
    {
      //System.out.println("freeA");
            InterruptStatus.restoreIntrFlagIfSeen();
      restoreContextStack();
      tr.lcc = null;
      tr.cm = null;
     
      //System.out.println("free");
      //System.out.println(Runtime.getRuntime().freeMemory());
            memoryState.setLowMemory();
     
      //noMemory.printStackTrace();
      // throw Util.generateCsSQLException(SQLState.LOGIN_FAILED, noMemory.getMessage(), noMemory);
      throw NO_MEM;
    }
    catch (Throwable t) {
            InterruptStatus.restoreIntrFlagIfSeen();

            if (t instanceof StandardException)
            {
                StandardException se = (StandardException) t;
                if (se.getSeverity() < ExceptionSeverity.SESSION_SEVERITY)
                    se.setSeverity(ExceptionSeverity.SESSION_SEVERITY);
            }
            //DERBY-4856, assume database is not up
            tr.cleanupOnError(t, false);
      throw handleException(t);
    } finally {
View Full Code Here

    {
        int     lineNumber = -1;

        if ( importer != null ) { lineNumber = importer.getCurrentLineNumber(); }
       
        StandardException se = StandardException.newException
            ( SQLState.UNEXPECTED_IMPORT_ERROR, new Integer( lineNumber ), inputFile, t.getMessage() );
        se.initCause(t);

        return PublicAPI.wrapStandardException(se);
    }
View Full Code Here

      if ((gc == preStmt.getActivationClass()) && preStmt.upToDate())
        return;
    }

    StandardException se = StandardException.newException(SQLState.LANG_STATEMENT_NEEDS_RECOMPILE);
    se.setReport(StandardException.REPORT_NEVER);
    throw se;
  }
View Full Code Here

         */
        DataDictionary dd = activation.getLanguageConnectionContext().getDataDictionary();
        ConglomerateDescriptor cd = dd.getConglomerateDescriptor( heapConglom );
        TableDescriptor td = dd.getTableDescriptor(cd.getTableID());

        StandardException se = StandardException.newException(SQLState.LANG_CHECK_CONSTRAINT_VIOLATED,
          td.getQualifiedName(), checkName);

        throw se;
      }
    }
View Full Code Here

        startProviderService(actualProvider, serviceName, serviceProperties);
        return true; // we understand the type
      }
    }

    StandardException savedMse = null;

    for (Enumeration e = new ProviderEnumeration( properties); e.hasMoreElements(); ) {

      PersistentService provider = (PersistentService) e.nextElement();
View Full Code Here

            if (cm != previousCM)
                cm.cleanupOnError(StandardException.closeException());
           
    } catch (Throwable t) {

      StandardException se;
      // ensure that the severity will shutdown the service
      if ((t instanceof StandardException) && (((StandardException) t).getSeverity() == ExceptionSeverity.DATABASE_SEVERITY))
        se = (StandardException) t;
      else
        se = Monitor.exceptionStartingModule(t);

      if (cm != previousCM) {
        cm.cleanupOnError(se);
      }

      if (ts != null) {
        ts.shutdown();
        synchronized (this) {
          services.removeElement(ts);
        }

        // Service root will only have been created if
        // ts is non-null.
        boolean deleteOnError = (properties !=null ?
                     properties.getProperty(Property.DELETE_ROOT_ON_ERROR) !=null:false);
        if (create || deleteOnError)
          provider.removeServiceRoot(serviceName);
      }


      Throwable nested = se.getCause();

      // never hide ThreadDeath
      if (nested instanceof ThreadDeath)
        throw (ThreadDeath) nested;
View Full Code Here

            if (exLockStatus == StorageFile.NO_FILE_LOCK_SUPPORT)
            {
                if (fileLockExisted && !throwDBlckException)
                {

                    StandardException multipleJBMSWarning =
                      StandardException.newException(
                          SQLState.DATA_MULTIPLE_JBMS_WARNING, args);

                    String warningMsg =
                      MessageService.getCompleteMessage(
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

                Throwable rootCause = ioe;
                while (rootCause.getCause() != null) {
                    rootCause = rootCause.getCause();
                }
                if (rootCause instanceof StandardException) {
                    StandardException se = (StandardException)rootCause;
                    if (se.getMessageId().equals(
                            SQLState.DATA_CONTAINER_CLOSED)) {
                        throw StandardException.newException(
                                SQLState.BLOB_ACCESSED_AFTER_COMMIT, ioe);
                    }
                }
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.