Package org.hibernate

Examples of org.hibernate.TransactionException


      try {
        status = ut.getStatus();
      }
      catch (Exception e) {
        log.error("Could not determine transaction status after commit", e);
        throw new TransactionException("Could not determine transaction status after commit", e);
      }
      finally {
        /*if (status!=Status.STATUS_COMMITTED && status!=Status.STATUS_ROLLEDBACK) {
          log.warn("Transaction not complete - you should set hibernate.transaction.manager_lookup_class if cache is enabled");
          //throw exception??
View Full Code Here


    try {
      status = ut.getStatus();
    }
    catch (SystemException se) {
      log.error("Could not determine transaction status", se);
      throw new TransactionException("Could not determine transaction status", se);
    }
    if (status==Status.STATUS_UNKNOWN) {
      throw new TransactionException("Could not determine transaction status");
    }
    else {
      return JTAHelper.isRollback(status);
    }
  }
View Full Code Here

    try {
      status = ut.getStatus();
    }
    catch (SystemException se) {
      log.error("Could not determine transaction status", se);
      throw new TransactionException("Could not determine transaction status: ", se);
    }
    if (status==Status.STATUS_UNKNOWN) {
      throw new TransactionException("Could not determine transaction status");
    }
    else {
      return status==Status.STATUS_COMMITTED;
    }
  }
View Full Code Here

    try {
      status = ut.getStatus();
    }
    catch (SystemException se) {
      log.error("Could not determine transaction status", se);
      throw new TransactionException("Could not determine transaction status: ", se);
    }
    if (status==Status.STATUS_UNKNOWN) {
      throw new TransactionException("Could not determine transaction status");
    }
    else {
      return status==Status.STATUS_ACTIVE;
    }
  }
View Full Code Here

    else {
      try {
        getTransactionManager().getTransaction().registerSynchronization(sync);
      }
      catch (Exception e) {
        throw new TransactionException("could not register synchronization", e);
      }
    }
  }
View Full Code Here

  public void setTimeout(int seconds) {
    try {
      ut.setTransactionTimeout(seconds);
    }
    catch (SystemException se) {
      throw new TransactionException("could not set transaction timeout", se);
    }
  }
View Full Code Here

    log.debug("begin");
   
    boolean synchronization = jdbcContext.registerSynchronizationIfPossible();

    if ( !synchronization ) {
      throw new TransactionException("Could not register synchronization for container transaction");
    }

    begun = true;
   
    jdbcContext.afterTransactionBegin(this);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void commit() throws HibernateException {
    if (!begun) {
      throw new TransactionException("Transaction not successfully started");
    }

    log.debug("commit");

    boolean flush = !transactionContext.isFlushModeNever() &&
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void rollback() throws HibernateException {
    if (!begun) {
      throw new TransactionException("Transaction not successfully started");
    }

    log.debug("rollback");

    try {
      getTransaction().setRollbackOnly();
    }
    catch (SystemException se) {
      log.error("Could not set transaction to rollback only", se);
      throw new TransactionException("Could not set transaction to rollback only", se);
    }

    begun = false;

  }
View Full Code Here

    try {
      status = getTransaction().getStatus();
    }
    catch (SystemException se) {
      log.error("Could not determine transaction status", se);
      throw new TransactionException("Could not determine transaction status: ", se);
    }
    if (status==Status.STATUS_UNKNOWN) {
      throw new TransactionException("Could not determine transaction status");
    }
    else {
      return status==Status.STATUS_ACTIVE;
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.TransactionException

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.