Package javax.transaction

Examples of javax.transaction.UserTransaction.commit()


        } catch (RollbackAppRuntimeException e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
        }
        // tries to commit
        try {
            utx.commit();
            if (!canCommit) {
                fail("The transaction was marked as rolled back, the client cannot make the commit.");
            }
        } catch (Exception e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
View Full Code Here


        } catch (AppRuntimeException e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
        }
        // tries to commit
        try {
            utx.commit();
        } catch (Exception e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
        }
        // verifies if the table was created in the DATABASE_1
        ExceptionHandleUtil.verifyTable(DATABASE_1, ItfContainerTransaction.TABLE);
View Full Code Here

                    "The container did not throw the correct exception, the expected exception is "
                            + expectedException.getName() + ", but the container threw " + e.getClass().getName());
        }
        // tries to commit
        try {
            utx.commit();
            if (!canCommit) {
                fail("The transaction was marked as rolled back, the client cannot make the commit.");
            }
        } catch (Exception e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
View Full Code Here

     */
    public void getUserTransactionWithLookup() throws Exception {
        try {
            UserTransaction utx = TransactionHelper.getUserTransaction();
            utx.begin();
            utx.commit();
        } catch (Exception e) {
            throw new TransactionException("The bean cannot get the user transaction with the JNDI", e);
        }
    }

View Full Code Here

     */
    public void getUserTransactionWithEJBContext() throws Exception {
        try {
            UserTransaction utx = ctx.getUserTransaction();
            utx.begin();
            utx.commit();
        } catch (Exception e) {
            throw new TransactionException("The bean cannot get the user transaction with the EJBContext", e);
        }
    }

View Full Code Here

    public void testSessionSyncWithMandatory() throws Exception {
        UserTransaction utx = getUserTransaction();
        utx.begin();
        sfsbSessionSync.insertTableMandatory();
        try{
            utx.commit();
        }catch(Exception e){
           logger.debug("The method threw an expected exception {e}", e);
        }
        verifyCallbacks();
    }
View Full Code Here

    public void testSessionSyncWithUserTransAndSupports() throws Exception {
        UserTransaction utx = getUserTransaction();
        utx.begin();
        sfsbSessionSync.insertTableSupports();
        try{
            utx.commit();
        }catch(Exception e){
           logger.debug("The method threw an expected exception {e}", e);
        }
        verifyCallbacks();
    }
View Full Code Here

        }catch(CustomException01 e){
           logger.debug("The container threw an expected exception {0}", e);
        }finally{
            // the container must not mark the transaction for rollback, so the
            // commit should work.
            utx.commit();
        }
        //verifies if the commit worked
        verifyTable(DB_NAME);
    }
View Full Code Here

        }catch(RollbackApplicationException e){
           logger.debug("The container threw an expected exception {0}", e);
        }finally{
            // the container must not mark the transaction for rollback, so the
            // commit should work.
            utx.commit();
        }
        //verifies if the commit worked
        verifyTable(DB_NAME);
    }
    /**
 
View Full Code Here

           logger.debug("The container threw an expected exception {0}", e);
        }finally{
            // the container must mark the transaction for rollback, so the
            // commit should not work.
            try{
                utx.commit();
                fail("The container did not mark the transaction for rollback");
            }catch(Exception e){
                logger.debug("The container threw an expected exception {0}", e);
            }
        }
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.