Package org.springframework.transaction

Examples of org.springframework.transaction.NestedTransactionNotSupportedException


    try {
      doJtaBegin(txObject, definition);
    }
    catch (NotSupportedException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (UnsupportedOperationException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (SystemException ex) {
      throw new CannotCreateTransactionException("JTA failure on begin", ex);
    }
View Full Code Here


      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;
View Full Code Here

   */
  public Object createSavepoint() throws TransactionException {
    ConnectionHolder conHolder = getConnectionHolderForSavepoint();
    try {
      if (!conHolder.supportsSavepoints()) {
        throw new NestedTransactionNotSupportedException(
            "Cannot create a nested transaction because savepoints are not supported by your JDBC driver");
      }
    }
    catch (Throwable ex) {
      throw new NestedTransactionNotSupportedException(
          "Cannot create a nested transaction because your JDBC driver is not a JDBC 3.0 driver", ex);
    }
    try {
      return conHolder.createSavepoint();
    }
View Full Code Here

    }
  }

  protected ConnectionHolder getConnectionHolderForSavepoint() throws TransactionException {
    if (!isSavepointAllowed()) {
      throw new NestedTransactionNotSupportedException(
          "Transaction manager does not allow nested transactions");
    }
    if (!hasConnectionHolder()) {
      throw new TransactionUsageException(
          "Cannot create nested transaction if not exposing a JDBC transaction");
View Full Code Here

      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;
View Full Code Here

    try {
      doJtaBegin(txObject, definition);
    }
    catch (NotSupportedException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (UnsupportedOperationException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (SystemException ex) {
      throw new CannotCreateTransactionException("JTA failure on begin", ex);
    }
View Full Code Here

          definition, transaction, true, newSynchronization, debugEnabled, suspendedResources);
    }

    if (definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_NESTED) {
      if (!isNestedTransactionAllowed()) {
        throw new NestedTransactionNotSupportedException(
            "Transaction manager does not allow nested transactions by default - " +
            "specify 'nestedTransactionAllowed' property with value 'true'");
      }
      if (debugEnabled) {
        logger.debug("Creating nested transaction with name [" + definition.getName() + "]");
View Full Code Here

   * This implementation creates a JDBC 3.0 Savepoint and returns it.
   * @see java.sql.Connection#setSavepoint
   */
  public Object createSavepoint() throws TransactionException {
    if (!savepointClassAvailable) {
      throw new NestedTransactionNotSupportedException(
          "Cannot create a nested JDBC transaction because you are not running on JDK 1.4 or higher");
    }
    ConnectionHolder conHolder = getConnectionHolderForSavepoint();
    try {
      if (!conHolder.supportsSavepoints()) {
        throw new NestedTransactionNotSupportedException(
            "Cannot create a nested transaction because savepoints are not supported by your JDBC driver");
      }
    }
    catch (Throwable ex) {
      throw new NestedTransactionNotSupportedException(
          "Cannot create a nested transaction because your JDBC driver is not a JDBC 3.0 driver", ex);
    }
    try {
      return conHolder.createSavepoint();
    }
View Full Code Here

    }
  }

  protected ConnectionHolder getConnectionHolderForSavepoint() throws TransactionException {
    if (!isSavepointAllowed()) {
      throw new NestedTransactionNotSupportedException(
          "Transaction manager does not allow nested transactions");
    }
    if (!hasConnectionHolder()) {
      throw new TransactionUsageException(
          "Cannot create nested transaction if not exposing a JDBC transaction");
View Full Code Here

    try {
      doJtaBegin(txObject, definition);
    }
    catch (NotSupportedException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (UnsupportedOperationException ex) {
      // assume nested transaction not supported
      throw new NestedTransactionNotSupportedException(
          "JTA implementation does not support nested transactions", ex);
    }
    catch (SystemException ex) {
      throw new CannotCreateTransactionException("JTA failure on begin", ex);
    }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.NestedTransactionNotSupportedException

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.