Package javax.transaction

Examples of javax.transaction.Transaction.commit()


    assertEquals( getSessions().getStatistics().getQueryCachePutCount(), 2 );
    assertEquals( getSessions().getStatistics().getQueryCacheHitCount(), 0 );
    assertEquals( getSessions().getStatistics().getQueryCacheMissCount(), 2 );

    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


      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

      {
         local.set("Something");
      }
      finally
      {
         tx.commit();
      }
      assertEquals(null, local.get());
      tm.suspend();
   }
  
View Full Code Here

         local.set("Something");
         assertEquals("Something", local.get());
      }
      finally
      {
         tx.commit();
      }
      assertEquals("Initial", local.get());
      tm.suspend();
   }
  
View Full Code Here

      {
         throw new IllegalStateException("Tx not found: " + id);
      }
      else
      {
         tx.commit();
      }
   }

   public void txRegisterSync() throws Exception
   {
View Full Code Here

        
         if (tx != null)
         {
            try
            {
               tx.commit();
            }
            catch (Exception ignore)
            {             
            }
         }
View Full Code Here

        tm.begin();
        Transaction tx = tm.getTransaction();
        tx.enlistResource(s);

        tx.delistResource(s, XAResource.TMSUCCESS);
        tx.commit();

    }

    protected static class TestXAResourceManager extends AbstractXAResourceManager
    {
View Full Code Here

        Transaction tx = tm.getTransaction();
        assertNotNull("Transaction should have started.", tx);
        assertEquals("TX should have been active", Status.STATUS_ACTIVE, tx.getStatus());

        tx.commit();

        tx = tm.getTransaction();
        assertNotNull("Committing via TX handle should NOT disassociated TX from the current thread.",
                      tx);
        assertEquals("TX status should have been COMMITTED.", Status.STATUS_COMMITTED, tx.getStatus());
View Full Code Here

      assert "v".equals(cache.get(AB, "k"));
      assert "v".equals(cache.get(ABC, "k"));

      tm.resume(t2);
      t2.commit();

      assert "v2".equals(cache.get(AB, "k"));
      assert "v".equals(cache.get(ABC, "k"));
   }
View Full Code Here

      assert "v2".equals(cache.get(AB, "k"));
      assert null == cache.get(ABC, "k");

      tm.resume(t2);
      t2.commit();

      assert "v2".equals(cache.get(AB, "k"));
      assert "v".equals(cache.get(ABC, "k"));
   }
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.