Package org.pentaho.platform.api.repository

Examples of org.pentaho.platform.api.repository.RepositoryException


  public void testMiscExceptionClasses() {
    // Making sure we create an instance of all the Pentaho
    // Exception classes.
    startTest();
    Exception ex = new RepositoryException();
    Exception ex2 = new RepositoryException( "Ignored" ); //$NON-NLS-1$
    Exception ex3 = new RepositoryException( ex2 );
    Exception ex4 = new RepositoryException( "Ignored", ex3 ); //$NON-NLS-1$
    Exception ex5 = new AuditException();
    Exception ex6 = new AuditException( "Ignored" ); //$NON-NLS-1$
    Exception ex7 = new AuditException( "Ignored", ex ); //$NON-NLS-1$
    Exception ex8 = new AuditException( ex4 );
    ex = new ContentException( "Ignored" ); //$NON-NLS-1$
View Full Code Here


  protected void checkType( final String key, final String type, final boolean setIt ) {
    Map localTypesMap = getTypesMap();
    String curType = (String) localTypesMap.get( key );
    if ( curType != null ) {
      if ( !curType.equals( type ) ) {
        throw new RepositoryException( Messages.getInstance().getErrorString(
            "RTREPO.ERROR_0001_INVALIDTYPE", curType, type ) ); //$NON-NLS-1$
      }
    }
    if ( setIt ) {
      localTypesMap.put( key, type );
View Full Code Here

        try {
          HibernateUtil.sessionFactory = HibernateUtil.getConfiguration().buildSessionFactory();
        } catch ( Exception ex ) {
          HibernateUtil.log.error(
              Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
          throw new RepositoryException( Messages.getInstance().getErrorString(
              "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
        }
      }
    } else {
      try {
        HibernateUtil.getConfiguration().buildSessionFactory();
      } catch ( Exception ex ) {
        HibernateUtil.log.error(
            Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
        throw new RepositoryException( Messages.getInstance().getErrorString(
            "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

          HibernateUtil.sessionFactory = cfg.buildSessionFactory();
          HibernateUtil.configuration = cfg;
        } catch ( Exception ex ) {
          HibernateUtil.log.error(
              Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
          throw new RepositoryException( Messages.getInstance().getErrorString(
              "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
        }
      }
    } else {
      try {
        cfg.buildSessionFactory();
        HibernateUtil.configuration = cfg;
      } catch ( Exception ex ) {
        HibernateUtil.log.error(
            Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
        throw new RepositoryException( Messages.getInstance().getErrorString(
            "HIBUTIL.ERROR_0007_REBUILD_SESSION_FACTORY" ), ex ); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

        }
        HibernateUtil.threadSession.set( s );
      }
    } catch ( HibernateException ex ) {
      HibernateUtil.log.error( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0005_GET_SESSION" ), ex ); //$NON-NLS-1$
      throw new RepositoryException( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0005_GET_SESSION" ), ex ); //$NON-NLS-1$
    }
    return s;
  }
View Full Code Here

  public static void flushSession() throws RepositoryException {
    try {
      Session s = HibernateUtil.getSession();
      s.flush();
    } catch ( HibernateException ex ) {
      throw new RepositoryException( ex );
    }
  }
View Full Code Here

      }
      HibernateUtil.threadTransaction.set( null );
    } catch ( HibernateException ex ) {
      HibernateUtil.log.error( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0009_CLOSE_SESSION" ), ex ); //$NON-NLS-1$
      HibernateUtil.threadTransaction.set( null );
      throw new RepositoryException( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0009_CLOSE_SESSION" ), ex ); //$NON-NLS-1$
    }

  }
View Full Code Here

        tx = HibernateUtil.getSession().beginTransaction();
        HibernateUtil.threadTransaction.set( tx );
      }
    } catch ( HibernateException ex ) {
      HibernateUtil.log.error( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0004_START_TRANS" ), ex ); //$NON-NLS-1$
      throw new RepositoryException( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0004_START_TRANS" ), ex ); //$NON-NLS-1$
    }
  }
View Full Code Here

        HibernateUtil.rollbackTransaction();
      } catch ( Exception e2 ) {
        // CHECKSTYLES IGNORE
      }
      if ( ex instanceof ConstraintViolationException ) {
        throw new RepositoryException( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0008_COMMIT_TRANS" ), ex ); //$NON-NLS-1$
      }
      // throw new
      // RepositoryException(Messages.getInstance().getErrorString("HIBUTIL.ERROR_0008_COMMIT_TRANS"),
      // ex); //$NON-NLS-1$
    } finally {
View Full Code Here

        }
        tx.rollback();
      }
    } catch ( HibernateException ex ) {
      HibernateUtil.log.error( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0003_ROLLBACK" ), ex ); //$NON-NLS-1$
      throw new RepositoryException( Messages.getInstance().getErrorString( "HIBUTIL.ERROR_0003_ROLLBACK" ), ex ); //$NON-NLS-1$
    } finally {
      HibernateUtil.closeSession();
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.repository.RepositoryException

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.