Package org.springframework.transaction

Examples of org.springframework.transaction.InvalidIsolationLevelException


   */
  protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel)
      throws InvalidIsolationLevelException, SystemException {

    if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException(
        "JtaTransactionManager does not support custom isolation levels by default - " +
        "switch 'allowCustomIsolationLevels' to 'true'");
    }
  }
View Full Code Here


  @Override
  public Object beginTransaction(EntityManager entityManager, TransactionDefinition definition)
      throws PersistenceException, SQLException, TransactionException {

    if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException(getClass().getSimpleName() +
          " does not support custom isolation levels due to limitations in standard JPA. " +
          "Specific arrangements may be implemented in custom JpaDialect variants.");
    }
    entityManager.getTransaction().begin();
    return null;
View Full Code Here

      }
      else {
        // Not allowed to change the transaction settings of the JDBC Connection.
        if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
          // We should set a specific isolation level but are not allowed to...
          throw new InvalidIsolationLevelException(
              "HibernateTransactionManager is not allowed to support custom isolation levels: " +
              "make sure that its 'prepareConnection' flag is on (the default) and that the " +
              "Hibernate connection release mode is set to 'on_close' (SpringTransactionFactory's default). " +
              "Make sure that your LocalSessionFactoryBean actually uses SpringTransactionFactory: Your " +
              "Hibernate properties should *not* include a 'hibernate.transaction.factory_class' property!");
View Full Code Here

  }

  @Override
  protected void doBegin(Object transaction, TransactionDefinition definition) {
    if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException("JMS does not support an isolation level concept");
    }

    JmsTransactionObject txObject = (JmsTransactionObject) transaction;
    Connection con = null;
    Session session = null;
View Full Code Here

      }
      else {
        // Not allowed to change the transaction settings of the JDBC Connection.
        if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
          // We should set a specific isolation level but are not allowed to...
          throw new InvalidIsolationLevelException(
              "HibernateTransactionManager is not allowed to support custom isolation levels: " +
              "make sure that its 'prepareConnection' flag is on (the default) and that the " +
              "Hibernate connection release mode is set to 'on_close' (the default for JDBC).");
        }
        if (logger.isDebugEnabled()) {
View Full Code Here

        Connection con = HibernateConnectionHandle.doGetConnection(session);
        previousIsolationLevel = DataSourceUtils.prepareConnectionForTransaction(con, definition);
        resetConnection = true;
      }
      else if (isolationLevelNeeded) {
        throw new InvalidIsolationLevelException(getClass().getSimpleName() +
            " does not support custom isolation levels since the 'prepareConnection' flag is off. " +
            "This is the case on Hibernate 3.6 by default; either switch that flag at your own risk " +
            "or upgrade to Hibernate 4.x, with 4.2+ recommended.");
      }
    }
View Full Code Here

   */
  protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel)
      throws InvalidIsolationLevelException, SystemException {

    if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException(
          "JtaTransactionManager does not support custom isolation levels by default - " +
          "switch 'allowCustomIsolationLevels' to 'true'");
    }
  }
View Full Code Here

   */
  public Object beginTransaction(Transaction transaction, TransactionDefinition definition)
      throws JDOException, SQLException, TransactionException {

    if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException(
          "Standard JDO does not support custom isolation levels: " +
          "use a special JdoDialect implementation for your JDO provider");
    }
    transaction.begin();
    return null;
View Full Code Here

    return (txObject.getResourceHolder() != null);
  }

  protected void doBegin(Object transaction, TransactionDefinition definition) {
    if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException("JMS does not support an isolation level concept");
    }
    JmsTransactionObject txObject = (JmsTransactionObject) transaction;
    Connection con = null;
    Session session = null;
    try {
View Full Code Here

   */
  protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel)
      throws InvalidIsolationLevelException, SystemException {

    if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
      throw new InvalidIsolationLevelException(
          "JtaTransactionManager does not support custom isolation levels by default - " +
          "switch 'allowCustomIsolationLevels' to 'true'");
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.transaction.InvalidIsolationLevelException

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.