Package javax.transaction

Examples of javax.transaction.UserTransaction.begin()


     * @output the method execution without error
     * @throws Exception if an error during the tests occurs.
     */
    public void testCallOtherBeanNotSupWithTrans() throws Exception {
        UserTransaction utx = ExceptionHandleUtil.getUserTransaction();
        utx.begin();

        try {
            getRuntimeBean().insertTablesUsingAuxBeanNotSup(DATABASE_1, DATABASE_2);
            fail("The container did not throw the EJBTransactionRolledbackException.");
        } catch (EJBTransactionRolledbackException e) {
View Full Code Here


     * @output the method execution without error
     * @throws Exception if an error during the tests occurs.
     */
    public void testCallOtherBeanReqWithTrans() throws Exception {
        UserTransaction utx = ExceptionHandleUtil.getUserTransaction();
        utx.begin();
        try {
            getRuntimeBean().insertTablesUsingAuxBeanReq(DATABASE_1, DATABASE_2);
            fail("The container did not throw the EJBTransactionRolledbackException.");
        } catch (EJBTransactionRolledbackException e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
View Full Code Here

     * @throws Exception if an error during the tests occurs.
     */
    @Override
    public void testCallOtherBeanNotSup() throws Exception {
        UserTransaction utx = ExceptionHandleUtil.getUserTransaction();
        utx.begin();
        try {
            getRuntimeBean().insertTablesUsingAuxBeanNotSup(DATABASE_1, DATABASE_2);
            fail("The container did not throw the EJBTransactionRolledbackException.");
        } catch (EJBTransactionRolledbackException e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
View Full Code Here

     * @throws Exception if an error during the tests occurs.
     */
    @Override
    public void testCallOtherBeanReq() throws Exception {
        UserTransaction utx = ExceptionHandleUtil.getUserTransaction();
        utx.begin();
        try {
            getRuntimeBean().insertTablesUsingAuxBeanReq(DATABASE_1, DATABASE_2);
            fail("The container did not throw the EJBException.");
        } catch (EJBTransactionRolledbackException e) {
            logger.debug("The bean threw an expected error during the execution {0}", e);
View Full Code Here

        // calls a method that starts a transaction
        sfsbBeanManagedTransaction.insertTableWithoutCommitTransaction();
        // gets the transaction
        UserTransaction utx = TransactionHelper.getInternalUserTransaction();
        // starts the transaction
        utx.begin();
        // makes a rollback in the bean transaction, the container
        // 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
View Full Code Here

    @AroundInvoke
    protected Object intercept(final InvocationContext ic) throws Exception {
        UserTransaction utx;
        try{
            utx = ctx.getUserTransaction();
            utx.begin();
        }catch(Exception e){
            utx = null;
        }

        super.access00();
View Full Code Here

    private void access() throws Exception {
        UserTransaction utx;

        try {
            utx = ctx.getUserTransaction();
            utx.begin();
        } catch (Exception e) {
            utx = null;
        }

        super.access00();
View Full Code Here

     */
    public void deleteTableWithBeginCommit(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException, HeuristicRollbackException, RollbackException,
            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.deleteTable(TABLE);
            }
View Full Code Here

     */
    public void insertTableWithBeginCommit(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException, HeuristicRollbackException, RollbackException,
            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.insertTable(TABLE);
            }
View Full Code Here

     * @throws NotSupportedException if the resquest cannot be made.
     */
    public void insertTableWithoutCommit(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        if (!callOnlyTransaction) {
            TableManager tableManager = new TableManager(dbName);
            tableManager.insertTable(TABLE);
        }
    }
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.