Package javax.transaction

Examples of javax.transaction.UserTransaction.begin()


      {
         InitialContext ctx = new InitialContext();
         Queue queue = (Queue) ctx.lookup("queue/testQueue");
         UserTransaction ut = sessionCtx.getUserTransaction();
         ut.setTransactionTimeout(5);
         ut.begin();
         try
         {
            ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:JmsXA");
            javax.jms.Connection c = cf.createConnection();
            try
View Full Code Here


      try
      {
         InitialContext ctx = new InitialContext();
         Queue queue = (Queue) ctx.lookup("queue/testQueue");
         UserTransaction ut = sessionCtx.getUserTransaction();
         ut.begin();
         try
         {
            ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:JmsXA");
            javax.jms.Connection c = cf.createConnection();
            try
View Full Code Here

   {
      System.setProperty(Context.PROVIDER_URL, getServerHost() + ":1099");
      InitialContext ctx = new InitialContext();
      UserTransaction ut = (UserTransaction) ctx.lookup("UserTransaction");

      ut.begin();
      try
      {
         ut.begin();
         fail("Attempt to start a nested user transaction should fail with NotSupportedException.");
      }
View Full Code Here

      UserTransaction ut = (UserTransaction) ctx.lookup("UserTransaction");

      ut.begin();
      try
      {
         ut.begin();
         fail("Attempt to start a nested user transaction should fail with NotSupportedException.");
      }
      catch(NotSupportedException e)
      {
         // expected
View Full Code Here

         return new UserTransaction()
         {
            public void begin() throws NotSupportedException, SystemException
            {
               checkUserTransactionMethods();
               ut.begin();
            }

            public void commit() throws RollbackException,
               HeuristicMixedException,
               HeuristicRollbackException,
View Full Code Here

   public void doNormal() throws RemoteException
   {
      UserTransaction ut = sessionCtx.getUserTransaction();
      try
      {
         ut.begin();
         ut.commit();
      }
      catch (Exception e)
      {
         throw new RemoteException("Error", e);
View Full Code Here

   public void doIncomplete() throws RemoteException
   {
      UserTransaction ut = sessionCtx.getUserTransaction();
      try
      {
         ut.begin();
      }
      catch (Exception e)
      {
         throw new RemoteException("Error", e);
      }
View Full Code Here

   {
      UserTransaction ut = sessionCtx.getUserTransaction();
      try
      {
         ut.setTransactionTimeout(5);
         ut.begin();
         Thread.sleep(10000);
      }
      catch (InterruptedException ignored)
      {
      }
View Full Code Here

      try
      {
         InitialContext ctx = new InitialContext();
        
         t = (UserTransaction) ctx.lookup("UserTransaction");
         t.begin();
     
         EntityManager em = (EntityManager) Component.getInstance("entityManager", true);
        
         List<Auction> auctions = em.createQuery("select a from Auction a").getResultList();
        
View Full Code Here

        try {
            progress.setStatus("Purging index");
            log.debug("deleting indexed documents of entity: " + entityClass.getName());
            userTx = (UserTransaction)org.jboss.seam.Component.getInstance("org.jboss.seam.transaction.transaction");
            userTx.begin();

            EntityManager em = (EntityManager) Component.getInstance("entityManager");
            FullTextSession ftSession = (FullTextSession)em.getDelegate();

            // Delete all documents with "_hibernate_class" term of the selected entity
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.