Package org.springframework.transaction

Examples of org.springframework.transaction.TransactionSystemException


      Method getUserTransactionMethod =
          this.transactionHelperClass.getMethod("getUserTransaction", new Class[0]);
      return (UserTransaction) getUserTransactionMethod.invoke(this.transactionHelper, new Object[0]);
    }
    catch (InvocationTargetException ex) {
      throw new TransactionSystemException(
          "WebLogic's TransactionHelper/TxHelper.getUserTransaction() method failed", ex.getTargetException());
    }
    catch (Exception ex) {
      throw new TransactionSystemException(
          "Could not invoke WebLogic's TransactionHelper/TxHelper.getUserTransaction() method", ex);
    }
  }
View Full Code Here


      Method getTransactionManagerMethod =
          this.transactionHelperClass.getMethod("getTransactionManager", new Class[0]);
      return (TransactionManager) getTransactionManagerMethod.invoke(this.transactionHelper, new Object[0]);
    }
    catch (InvocationTargetException ex) {
      throw new TransactionSystemException(
          "WebLogic's TransactionHelper/TxHelper.getTransactionManager() method failed", ex.getTargetException());
    }
    catch (Exception ex) {
      throw new TransactionSystemException(
          "Could not invoke WebLogic's TransactionHelper/TxHelper.getTransactionManager() method", ex);
    }
  }
View Full Code Here

              getClass().getClassLoader().loadClass(TX_HELPER_CLASS_NAME);
          logger.debug("WebLogic 7.0 TxHelper found");
        }
      }
      catch (InvocationTargetException ex) {
        throw new TransactionSystemException(
            "WebLogic's TransactionHelper.getTransactionHelper() method failed", ex.getTargetException());
      }
      catch (Exception ex) {
        throw new TransactionSystemException(
            "Could not initialize WebLogicJtaTransactionManager because WebLogic API classes are not available",
            ex);
      }
    }
  }
View Full Code Here

      else {
        logger.warn("Support for WebLogic forceResume not available");
      }
    }
    catch (Exception ex) {
      throw new TransactionSystemException(
          "Could not initialize WebLogicJtaTransactionManager because WebLogic API classes are not available",
          ex);
    }
  }
View Full Code Here

          this.beginWithNameMethod.invoke(txObject.getUserTransaction(),
              new Object[] {definition.getName()});
        }
      }
      catch (InvocationTargetException ex) {
        throw new TransactionSystemException(
            "WebLogic's UserTransaction.begin() method failed", ex.getTargetException());
      }
      catch (Exception ex) {
        throw new TransactionSystemException(
            "Could not invoke WebLogic's UserTransaction.begin() method", ex);
      }
    }
    else {
      // No WebLogic UserTransaction available or no transaction name specified
      // -> standard JTA begin call.
      applyTimeout(txObject, timeout);
      txObject.getUserTransaction().begin();
    }

    // Specify isolation level, if any, through corresponding WebLogic transaction property.
    if (this.weblogicTransactionManagerAvailable) {
      if (definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) {
        try {
          Transaction tx = getTransactionManager().getTransaction();
          Integer isolationLevel = new Integer(definition.getIsolationLevel());
          /*
          weblogic.transaction.Transaction wtx = (weblogic.transaction.Transaction) tx;
          wtx.setProperty(ISOLATION_LEVEL_KEY, isolationLevel);
          */
          this.setPropertyMethod.invoke(tx, new Object[] {ISOLATION_LEVEL_KEY, isolationLevel});
        }
        catch (InvocationTargetException ex) {
          throw new TransactionSystemException(
              "WebLogic's Transaction.setProperty(String, Serializable) method failed", ex.getTargetException());
        }
        catch (Exception ex) {
          throw new TransactionSystemException(
              "Could not invoke WebLogic's Transaction.setProperty(String, Serializable) method", ex);
        }
      }
    }
    else {
View Full Code Here

      */
      try {
        this.forceResumeMethod.invoke(getTransactionManager(), new Object[] {suspendedTransaction});
      }
      catch (InvocationTargetException ex2) {
        throw new TransactionSystemException(
            "WebLogic's TransactionManager.forceResume(Transaction) method failed", ex2.getTargetException());
      }
      catch (Exception ex2) {
        throw new TransactionSystemException(
            "Could not access WebLogic's TransactionManager.forceResume(Transaction) method", ex2);
      }
    }
  }
View Full Code Here

    try {
      txObject.getSessionHolder().getTransaction().commit();
    }
    catch (org.hibernate.TransactionException ex) {
      // assumably from commit call to the underlying JDBC connection
      throw new TransactionSystemException("Could not commit Hibernate transaction", ex);
    }
    catch (HibernateException ex) {
      // assumably failed to flush changes to database
      throw convertHibernateAccessException(ex);
    }
View Full Code Here

    }
    try {
      txObject.getSessionHolder().getTransaction().rollback();
    }
    catch (org.hibernate.TransactionException ex) {
      throw new TransactionSystemException("Could not roll back Hibernate transaction", ex);
    }
    catch (HibernateException ex) {
      // Shouldn't really happen, as a rollback doesn't cause a flush.
      throw convertHibernateAccessException(ex);
    }
View Full Code Here

    try {
      int jtaStatus = this.userTransaction.getStatus();
      return (jtaStatus == Status.STATUS_MARKED_ROLLBACK || jtaStatus == Status.STATUS_ROLLEDBACK);
    }
    catch (SystemException ex) {
      throw new TransactionSystemException("JTA failure on getStatus", ex);
    }
  }
View Full Code Here

      // Return null to make the superclass perform its standard J2EE lookup,
      // which will work on earlier OC4J versions.
      return null;
    }
    catch (InvocationTargetException ex) {
      throw new TransactionSystemException(
          "OC4J's TransactionUtility.getOC4JUserTransaction() method failed", ex.getTargetException());
    }
    catch (Exception ex) {
      throw new TransactionSystemException(
          "Could not invoke OC4J's TransactionUtility.getOC4JUserTransaction() method", 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.