Package org.springframework.transaction

Examples of org.springframework.transaction.TransactionSystemException


        DataAccessException dex = getJpaDialect().translateExceptionIfPossible((RuntimeException) ex.getCause());
        if (dex != null) {
          throw dex;
        }
      }
      throw new TransactionSystemException("Could not commit JPA transaction", ex);
    }
    catch (RuntimeException ex) {
      // Assumably failed to flush changes to database.
      throw DataAccessUtils.translateIfNecessary(ex, getJpaDialect());
    }
View Full Code Here


      if (tx.isActive()) {
        tx.rollback();
      }
    }
    catch (PersistenceException ex) {
      throw new TransactionSystemException("Could not roll back JPA transaction", ex);
    }
    finally {
      if (!txObject.isNewEntityManagerHolder()) {
        // Clear all pending inserts/updates/deletes in the EntityManager.
        // Necessary for pre-bound EntityManagers, to avoid inconsistent state.
View Full Code Here

        logger.debug("Retrieving JTA UserTransaction from JNDI location [" + userTransactionName + "]");
      }
      return (UserTransaction) getJndiTemplate().lookup(userTransactionName, UserTransaction.class);
    }
    catch (NamingException ex) {
      throw new TransactionSystemException(
          "JTA UserTransaction is not available at JNDI location [" + userTransactionName + "]", ex);
    }
  }
View Full Code Here

        logger.debug("Retrieving JTA TransactionManager from JNDI location [" + transactionManagerName + "]");
      }
      return (TransactionManager) getJndiTemplate().lookup(transactionManagerName, TransactionManager.class);
    }
    catch (NamingException ex) {
      throw new TransactionSystemException(
          "JTA TransactionManager is not available at JNDI location [" + transactionManagerName + "]", ex);
    }
  }
View Full Code Here

      Class registryClass =
          ClassUtils.forName(TRANSACTION_SYNCHRONIZATION_REGISTRY_CLASS_NAME, getClass().getClassLoader());
      return getJndiTemplate().lookup(registryName, registryClass);
    }
    catch (ClassNotFoundException ex) {
      throw new TransactionSystemException(
          "JTA 1.1 [" + TRANSACTION_SYNCHRONIZATION_REGISTRY_CLASS_NAME + "] not available");
    }
    catch (NamingException ex) {
      throw new TransactionSystemException(
          "JTA TransactionSynchronizationRegistry is not available at JNDI location [" + registryName + "]", ex);
    }
  }
View Full Code Here

    JtaTransactionObject txObject = (JtaTransactionObject) transaction;
    try {
      return (txObject.getUserTransaction().getStatus() != Status.STATUS_NO_TRANSACTION);
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on getStatus", ex);
    }
  }
View Full Code Here

    JtaTransactionObject txObject = (JtaTransactionObject) transaction;
    try {
      return doJtaSuspend(txObject);
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on suspend", ex);
    }
  }
View Full Code Here

    }
    catch (InvalidTransactionException ex) {
      throw new IllegalTransactionStateException("Tried to resume invalid JTA transaction", ex);
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on resume", ex);
    }
  }
View Full Code Here

    }
    catch (HeuristicRollbackException ex) {
      throw new HeuristicCompletionException(HeuristicCompletionException.STATE_ROLLED_BACK, ex);
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on commit", ex);
    }
  }
View Full Code Here

      if (txObject.getUserTransaction().getStatus() != Status.STATUS_NO_TRANSACTION) {
        txObject.getUserTransaction().rollback();
      }
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on rollback", ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.TransactionSystemException

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.