Package org.springframework.transaction

Examples of org.springframework.transaction.IllegalTransactionStateException


    boolean joinTx = false;
    boolean newSynch = false;

    if (existingTx) {
      if (pb == TransactionDefinition.PROPAGATION_NEVER) {
        throw new IllegalTransactionStateException(
            "Transaction propagation 'never' but existing transaction found");
      }
      if (pb == TransactionDefinition.PROPAGATION_NESTED) {
        throw new NestedTransactionNotSupportedException(
            "Transaction propagation 'nested' not supported for WebSphere UOW transactions");
      }
      if (pb == TransactionDefinition.PROPAGATION_SUPPORTS ||
          pb == TransactionDefinition.PROPAGATION_REQUIRED || pb == TransactionDefinition.PROPAGATION_MANDATORY) {
        joinTx = true;
        newSynch = (getTransactionSynchronization() != SYNCHRONIZATION_NEVER);
      }
      else if (pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED) {
        uowType = UOWSynchronizationRegistry.UOW_TYPE_LOCAL_TRANSACTION;
        newSynch = (getTransactionSynchronization() == SYNCHRONIZATION_ALWAYS);
      }
      else {
        newSynch = (getTransactionSynchronization() != SYNCHRONIZATION_NEVER);
      }
    }
    else {
      if (pb == TransactionDefinition.PROPAGATION_MANDATORY) {
        throw new IllegalTransactionStateException(
            "Transaction propagation 'mandatory' but no existing transaction found");
      }
      if (pb == TransactionDefinition.PROPAGATION_SUPPORTS ||
          pb == TransactionDefinition.PROPAGATION_NOT_SUPPORTED || pb == TransactionDefinition.PROPAGATION_NEVER) {
        uowType = UOWSynchronizationRegistry.UOW_TYPE_LOCAL_TRANSACTION;
View Full Code Here


  protected void doBegin(Object transaction, TransactionDefinition definition) {
    HibernateTransactionObject txObject = (HibernateTransactionObject) transaction;

    if (txObject.hasConnectionHolder() && !txObject.getConnectionHolder().isSynchronizedWithTransaction()) {
      throw new IllegalTransactionStateException(
          "Pre-bound JDBC Connection found! HibernateTransactionManager does not support " +
          "running within DataSourceTransactionManager if told to manage the DataSource itself. " +
          "It is recommended to use a single HibernateTransactionManager for all transactions " +
          "on a single DataSource, no matter whether Hibernate or JDBC access.");
    }
View Full Code Here

  @Override
  protected void doBegin(Object transaction, TransactionDefinition definition) {
    HibernateTransactionObject txObject = (HibernateTransactionObject) transaction;

    if (txObject.hasConnectionHolder() && !txObject.getConnectionHolder().isSynchronizedWithTransaction()) {
      throw new IllegalTransactionStateException(
          "Pre-bound JDBC Connection found! HibernateTransactionManager does not support " +
          "running within DataSourceTransactionManager if told to manage the DataSource itself. " +
          "It is recommended to use a single HibernateTransactionManager for all transactions " +
          "on a single DataSource, no matter whether Hibernate or JDBC access.");
    }
View Full Code Here

  @Override
  protected void doBegin(Object transaction, TransactionDefinition definition) {
    JpaTransactionObject txObject = (JpaTransactionObject) transaction;

    if (txObject.hasConnectionHolder() && !txObject.getConnectionHolder().isSynchronizedWithTransaction()) {
      throw new IllegalTransactionStateException(
          "Pre-bound JDBC Connection found! JpaTransactionManager does not support " +
          "running within DataSourceTransactionManager if told to manage the DataSource itself. " +
          "It is recommended to use a single JpaTransactionManager for all transactions " +
          "on a single DataSource, no matter whether JPA or JDBC access.");
    }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.IllegalTransactionStateException

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.