Package org.molgenis.framework.db

Examples of org.molgenis.framework.db.DatabaseException


  }

  @Override
  public void setOrderByField(String orderByField) throws DatabaseException
  {
    if (orderByField == null || orderByField.equals("")) throw new DatabaseException("orderByField cannot be null");

    // pagingState = State.FIRST;
    this.orderByField = orderByField;
    logger.debug("set order by field to '" + orderByField + "'");
  }
View Full Code Here


    try
    {
      if (inTransaction)
      {
        logger.error("BeginTx failed: transaction already begun");
        throw new DatabaseException("BeginTx failed: transaction already begun");
      }
      connection.setAutoCommit(false);
      inTransaction = true;
      logger.debug("begin transaction");
    }
    catch (SQLException sqle)
    {
      logger.error("beginTx failed: " + sqle.getMessage());
      throw new DatabaseException(sqle);
    }
  }
View Full Code Here

  @Override
  public void commitTx() throws DatabaseException
  {
    try
    {
      if (!inTransaction) throw new DatabaseException("commitTx failed: no active transaction");
      connection.commit();
      connection.setAutoCommit(true);
      inTransaction = false;
      // FIXME in case of hsqldb we need to checkpoint
      // if(this.source.getDriverClassName().contains("hsql"))
      // this.executeQuery("checkpoint");
      logger.info("commited transaction");
    }
    catch (SQLException sqle)
    {
      logger.error("commitTx failed: " + sqle.getMessage());
      throw new DatabaseException(sqle);
    }
    finally
    {
      closeConnection();
    }
View Full Code Here

  @Override
  public void rollbackTx() throws DatabaseException
  {
    try
    {
      if (!inTransaction) throw new DatabaseException("rollbackTx failed: no active transaction");
      connection.rollback();
      connection.setAutoCommit(true);
      inTransaction = false;
      logger.info("rolled back transaction on " + this.connection.getMetaData().getURL());
    }
    catch (SQLException sqle)
    {
      logger.error("rollbackTx failed: " + sqle.getMessage());
      throw new DatabaseException(sqle);
    }
    finally
    {
      closeConnection();
    }
View Full Code Here

      return connection;
    }
    catch (Exception sqle)
    {
      logger.error("Cannot open connection: " + sqle.getMessage());
      throw new DatabaseException(sqle);
    }
  }
View Full Code Here

      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
      throw new DatabaseException(e);
    }
    finally
    {
      if (stmt != null) try
      {
View Full Code Here

                    predicate = cb.equal(lhs, rhs);
                  }
                  catch (IllegalAccessException ex)
                  {
                    LogFactory.getLog(JPAQueryGeneratorUtil.class.getName()).error(ex);
                    throw new DatabaseException(ex);
                  }
                }
                break;
              case NOT:
                predicate = cb.notEqual(lhs, rhs);
View Full Code Here

      // like Integer
    }
    catch (IllegalAccessException ex)
    {
      LogFactory.getLog(JPAQueryGeneratorUtil.class.getName()).error(ex);
      throw new DatabaseException(ex);
    }
    return null;
  }
View Full Code Here

      logger.debug("find(" + create().getClass().getSimpleName() + ", TupleWriter, " + Arrays.asList(rules)
          + "): wrote " + i + " lines.");
    }
    catch (Exception e)
    {
      throw new DatabaseException(e);
    }
  }
View Full Code Here

    }
    catch (Exception e)
    {
      logger.error("executeKeys(): " + e);
      e.printStackTrace();
      throw new DatabaseException(e.getMessage());
    }
    finally
    {
      try
      {
View Full Code Here

TOP

Related Classes of org.molgenis.framework.db.DatabaseException

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.