Package javax.transaction

Examples of javax.transaction.TransactionManager.suspend()


  public <T> T delegateWork(WorkExecutorVisitable<T> work, boolean transacted) throws HibernateException {
    TransactionManager transactionManager = transactionManager();

    try {
      // First we suspend any current JTA transaction
      Transaction surroundingTransaction = transactionManager.suspend();
      LOG.debugf( "Surrounding JTA transaction suspended [%s]", surroundingTransaction );

      boolean hadProblems = false;
      try {
        // then perform the requested work
View Full Code Here


      // further commands after one fails

      TransactionManager mgr = (TransactionManager)ctx.lookup(TransactionManagerService.JNDI_NAME);
      DataSource ds = (DataSource)ctx.lookup("java:/DefaultDS");

      javax.transaction.Transaction txOld = mgr.suspend();

      executeStatement(mgr, ds, "DROP TABLE JBM_POSTOFFICE");

      executeStatement(mgr, ds, "DROP TABLE JBM_MSG_REF");
View Full Code Here

      // further commands after one fails

      TransactionManager mgr = (TransactionManager)ctx.lookup(TransactionManagerService.JNDI_NAME);
      DataSource ds = (DataSource)ctx.lookup("java:/DefaultDS");

      javax.transaction.Transaction txOld = mgr.suspend();

      executeStatement(mgr, ds, "DELETE FROM JBM_POSTOFFICE");

      executeStatement(mgr, ds, "DELETE FROM JBM_MSG_REF");
View Full Code Here

      TransactionManager mgr = newTransactionManager();

      try
      {

         toResume = mgr.suspend();

         mgr.begin();

         started = mgr.getTransaction();
View Full Code Here

               checkStatelessDone(ejbName, null);
            }
         }
         finally
         {
            tm.suspend();
         }
      }
   }

}
View Full Code Here

   @AroundInvoke
   public Object invoke(InvocationContext invocation) throws Exception
   {
      TransactionManager tm = this.getTransactionManager();
      Transaction oldTx = tm.suspend();
      try
      {
         return handleInvocation(invocation);
      }
      finally
View Full Code Here

      boolean caughtException = false;

      try {
        // First we need to suspend any current JTA transaction and obtain
        // a JDBC connection
        surroundingTransaction = transactionManager.suspend();
        if ( log.isDebugEnabled() ) {
          log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
        }

        if ( transacted ) {
View Full Code Here

         if (newTx != null)
         {
            // remember the association
            transaction = newTx;
            // and suspend it.
            tm.suspend();
         }
         else
         {
            // forget any previous associated transaction
            transaction = null;
View Full Code Here

   {
      TransactionManager tm = this.getTransactionManager();
      Transaction tx = tm.getTransaction();
      if (tx != null)
      {
         tm.suspend();
         try
         {
            return invokeInNoTx(invocation);
         }
         catch (Exception e)
View Full Code Here

         }

         Transaction tx = tm.getTransaction();
         if (tx != null)
         {
            tm.suspend();
            try
            {
               return invokeInOurTx(invocation, tm);
            }
            finally
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.