Package org.hibernate

Examples of org.hibernate.TransactionException


        UserTransaction ut = getUserTransaction();
        return ut != null && JTAHelper.isInProgress( ut.getStatus() );
      }
    }
    catch ( SystemException se ) {
      throw new TransactionException( "Unable to check transaction status", se );
    }
  }
View Full Code Here


        isInitiator = true;
        LOG.debug( "Began a new JTA transaction" );
      }
    }
    catch ( Exception e ) {
      throw new TransactionException( "JTA transaction begin failed", e );
    }
  }
View Full Code Here

  }

  private UserTransaction locateUserTransaction() {
    final UserTransaction userTransaction = jtaPlatform().retrieveUserTransaction();
    if ( userTransaction == null ) {
      throw new TransactionException( "Unable to locate JTA UserTransaction" );
    }
    return userTransaction;
  }
View Full Code Here

      if ( userTransaction != null ) {
        try {
          userTransaction.setTransactionTimeout( getTimeout() );
        }
        catch ( SystemException e ) {
          throw new TransactionException( "Unable to apply requested transaction timeout", e );
        }
      }
      else {
        LOG.debug( "Unable to apply requested transaction timeout; no UserTransaction.  Will try later" );
      }
View Full Code Here

        userTransaction.commit();
        LOG.debug( "Committed JTA UserTransaction" );
      }
    }
    catch ( Exception e ) {
      throw new TransactionException( "JTA commit failed: ", e );
    }
  }
View Full Code Here

        }
        try {
          transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
        }
        catch (SystemException e) {
          throw new TransactionException( "Unable to determine UserTransaction status", e );
        }
      }
    }
    finally {
      isInitiator = false;
View Full Code Here

      else {
        markRollbackOnly();
      }
    }
    catch ( Exception e ) {
      throw new TransactionException( "JTA rollback failed", e );
    }
  }
View Full Code Here

    final int status;
    try {
      status = userTransaction.getStatus();
    }
    catch ( SystemException se ) {
      throw new TransactionException( "Could not determine transaction status: ", se );
    }
    return JtaStatusHelper.isActive( status );
  }
View Full Code Here

   */
  public static int getStatus(UserTransaction userTransaction) {
    try {
      final int status = userTransaction.getStatus();
      if ( status == Status.STATUS_UNKNOWN ) {
        throw new TransactionException( "UserTransaction reported transaction status as unknown" );
      }
      return status;
    }
    catch ( SystemException se ) {
      throw new TransactionException( "Could not determine transaction status", se );
    }
  }
View Full Code Here

   */
  public static int getStatus(TransactionManager transactionManager) {
    try {
      final int status = transactionManager.getStatus();
      if ( status == Status.STATUS_UNKNOWN ) {
        throw new TransactionException( "TransactionManager reported transaction status as unknwon" );
      }
      return status;
    }
    catch ( SystemException se ) {
      throw new TransactionException( "Could not determine transaction status", se );
    }
  }
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.