Package org.springframework.transaction

Examples of org.springframework.transaction.NestedTransactionNotSupportedException


   * <p>Default implementation always throws a NestedTransactionNotSupportedException.
   * @throws org.springframework.transaction.NestedTransactionNotSupportedException
   * if the underlying transaction does not support savepoints
   */
  protected SavepointManager getSavepointManager() {
    throw new NestedTransactionNotSupportedException("This transaction does not support savepoints");
  }
View Full Code Here


   * This implementation exposes the SavepointManager interface
   * of the underlying transaction object, if any.
   */
  protected SavepointManager getSavepointManager() {
    if (!isTransactionSavepointManager()) {
      throw new NestedTransactionNotSupportedException(
          "Transaction object [" + getTransaction() + "] does not support savepoints");
    }
    return (SavepointManager) getTransaction();
  }
View Full Code Here

   * <p>Default implementation always throws a NestedTransactionNotSupportedException.
   * @throws org.springframework.transaction.NestedTransactionNotSupportedException
   * if the underlying transaction does not support savepoints
   */
  protected SavepointManager getSavepointManager() {
    throw new NestedTransactionNotSupportedException("This transaction does not support savepoints");
  }
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

      }
    }

    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

    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

      getSavepointManager().releaseSavepoint(savepoint);
    }

    private SavepointManager getSavepointManager() {
      if (!isSavepointAllowed()) {
        throw new NestedTransactionNotSupportedException(
            "Transaction manager does not allow nested transactions");
      }
      SavepointManager savepointManager = getEntityManagerHolder().getSavepointManager();
      if (savepointManager == null) {
        throw new NestedTransactionNotSupportedException(
            "JpaDialect does not support savepoints - check your JPA provider's capabilities");
      }
      return savepointManager;
    }
View Full Code Here

  @Override
  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");
      }
      return conHolder.createSavepoint();
    }
    catch (SQLException ex) {
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 (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

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.