Package javax.transaction

Examples of javax.transaction.Transaction.commit()


         // Validates TX convertion
         assertFalse(state.getCurrentTxId() instanceof LocalTx);

         trans.delistResource(resource, XAResource.TMSUCCESS);

         trans.commit();

         // After commit the message should be consumed
         count = (Integer) ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(0, count.intValue());
      }
View Full Code Here


         assertEquals("one", messageReceived.getText());

         count = (Integer)ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(1, count.intValue());

         trans.commit();

         count = (Integer)ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(0, count.intValue());

      }
View Full Code Here

      throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
    Transaction tx = getCurrentTransaction();
      if ( tx == null ) {
      throw new IllegalStateException( "no current transaction to commit" );
    }
      tx.commit();
  }

  public void rollback() throws IllegalStateException, SecurityException, SystemException {
      Transaction tx = getCurrentTransaction();
        if ( tx == null ) {
View Full Code Here

                 currentTransaction.toString());
            logger.log(logMessage, LOG_CHANNEL, Logger.DEBUG);
        }

        try {
            currentTransaction.commit();
        } finally {
            bindings.remove(currentThread);
        }

    }
View Full Code Here

   private void commitTx()
   {
      try
      {
         Transaction tx = transactionManager.getTransaction();
         tx.commit();
      }
      catch (Exception e)
      {
         throw new EJBException("Cannot commit Tx", e);
      }
View Full Code Here

      {
         throw new IllegalStateException("Tx not found: " + id);
      }
      else
      {
         tx.commit();
      }
   }
  
   public void txRegisterSync() throws Exception
   {
View Full Code Here

            HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
      Transaction tx = getCurrentTransaction();
      if (tx == null) {
         throw new IllegalStateException("no current transaction to commit");
      }
      tx.commit();
   }

   public void rollback() throws IllegalStateException, SecurityException, SystemException {
      Transaction tx = getCurrentTransaction();
      if (tx == null) {
View Full Code Here

    Session s2 = openSession();
    foo = ( Map ) s2.get( "Item", "Foo" );
    SimpleJtaTransactionManagerImpl.getInstance().commit();

    SimpleJtaTransactionManagerImpl.getInstance().resume( tx1 );
    tx1.commit();

    getSessions().evictEntity( "Item" );

    SimpleJtaTransactionManagerImpl.getInstance().begin();
    s1 = openSession();
View Full Code Here

    s2 = openSession();
    s2.createCriteria( "Item" ).list();
    SimpleJtaTransactionManagerImpl.getInstance().commit();

    SimpleJtaTransactionManagerImpl.getInstance().resume( tx1 );
    tx1.commit();

    SimpleJtaTransactionManagerImpl.getInstance().begin();
    s2 = openSession();
    s2.createCriteria( "Item" ).list();
    SimpleJtaTransactionManagerImpl.getInstance().commit();
View Full Code Here

    assertEquals( getSessions().getStatistics().getQueryCachePutCount(), 1 );
    assertEquals( getSessions().getStatistics().getQueryCacheHitCount(), 1 );
    assertEquals( getSessions().getStatistics().getQueryCacheMissCount(), 1 );

    SimpleJtaTransactionManagerImpl.getInstance().resume( tx1 );
    tx1.commit();

    SimpleJtaTransactionManagerImpl.getInstance().begin();
    Session s3 = openSession();
    s3.createCriteria( "Item" ).addOrder( Order.asc( "description" ) )
        .setCacheable( true ).list();
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.