Package org.hibernate

Examples of org.hibernate.TransactionException


      try {
        status = userTransaction.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 {
        jdbcContext.afterTransactionCompletion( status == Status.STATUS_COMMITTED, this );
      }
    }
View Full Code Here


    try {
      status = userTransaction.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 = userTransaction.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 = userTransaction.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 {
      userTransaction.setTransactionTimeout( seconds );
    }
    catch ( SystemException se ) {
      throw new TransactionException( "could not set transaction timeout", se );
    }
  }
View Full Code Here

  private void setTimeout(PreparedStatement result) throws SQLException {
    if ( isTransactionTimeoutSet ) {
      int timeout = (int) ( transactionTimeout - ( System.currentTimeMillis() / 1000 ) );
      if (timeout<=0) {
        throw new TransactionException("transaction timeout expired");
      }
      else {
        result.setQueryTimeout(timeout);
      }
    }
View Full Code Here

      }
      catch( HibernateException e ) {
        throw e;
      }
      catch (Exception e) {
        throw new TransactionException( "could not register synchronization with JTA TransactionManager", e );
      }
    }
  }
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

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.