Package javax.transaction

Examples of javax.transaction.UserTransaction.commit()


                                                   env );
        ut.begin();
        completeWorkItemCommand = new CompleteWorkItemCommand();
        completeWorkItemCommand.setWorkItemId( workItem.getId() );
        service.execute( completeWorkItemCommand );
        ut.commit();

        workItem = handler.getWorkItem();
        assertNull( workItem );
        service.dispose();
View Full Code Here


                                                   env );
        ut.begin();
        getProcessInstanceCommand = new GetProcessInstanceCommand();
        getProcessInstanceCommand.setProcessInstanceId( processInstance.getId() );
        processInstance = service.execute( getProcessInstanceCommand );
        ut.commit();
        assertNull( processInstance );
        service.dispose();
    }

    @SuppressWarnings("unused")
View Full Code Here

            getRuntimeBean().insertCorrectFirstErrorSecond(DATABASE_1, DATABASE_2);
        } catch (EJBException e) {
            logger.debug("The bean threw an expected exception {0}", e);
        }
        // commits the transaction
        utx.commit();
        /*
         * the bean roll back must not to make any influence in the user
         * transaction context. So, the client table must be create correctly,
         * and consequently the "select" query in the table must not to throw
         * exception.
 
View Full Code Here

            } catch (TransactionException e) {
                throw e.getParentException();
            }
            // tries to commit the transaction
            try {
                utx.commit();
                fail("The transaction is marked as rollback. The client cannot make the commit.");
            } catch (Exception e) {
                logger.debug("Expected exception {0}", e);
            }
        } finally {
View Full Code Here

    public void testGetRollbackOnlyWithUserTransaction() throws Exception {
        UserTransaction utx = getUserTransaction();

        utx.begin();
        testGetRollbackOnly();
        utx.commit();
    }

    /**
     * Calls the getRollbackOnly that must throw an exception for this type of
     * transaction attribute.The EJBTransactionRequiredException is thrown,
View Full Code Here

            fail("The bean was not discarded.");
        }

        // tries to commit the transaction
        try {
            utx.commit();
            fail("The transaction is marked as rollback. The client cannot make the commit.");
        } catch (Exception e) {
            logger.debug("Expected exception {0}", e);
        }
View Full Code Here

        if (!ExceptionHandleUtil.isDiscarded(getRuntimeBean())) {
            fail("The bean was not discarded.");
        }
        // tries to commit the transaction
        try {
            utx.commit();
            fail("The transaction is marked as rollback. The client cannot make the commit.");
        } catch (Exception e) {
            logger.debug("Expected exception {0}", e);
        }
View Full Code Here

        // TODO - verifies if the container log the error.

        // tries to commit the transaction
        try {
            utx.commit();
            fail("The transaction is marked as rollback. The client cannot make the commit.");
        } catch (Exception e) {
            logger.debug("Expected exception {0}", e);
        }
View Full Code Here

        if (!ExceptionHandleUtil.isDiscarded(getRuntimeBean())) {
            fail("The bean was not discarded.");
        }
        // tries to commit the transaction
        try {
            utx.commit();
            fail("The transaction is marked as rollback. The client cannot make the commit.");
        } catch (Exception e) {
            logger.debug("Expected exception {0}", e);
        }
        // verifies if the transaction in the bean was rolled back.
View Full Code Here

        // must to resume the user transaction and execute the
        // bean transaction in other transaction
        sfsbBeanManagedTransaction.setRollback();
        // tries to commit the transaction to avoid a nested transaction
        try {
            utx.commit();
        } catch (Exception e) {
            logger.debug("Error when the transaction made a rollback {0}", e);
        }
        Integer[] expected = {new Integer(Status.STATUS_COMMITTED), new Integer(Status.STATUS_NO_TRANSACTION) };
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.