Package org.mule.api.transaction

Examples of org.mule.api.transaction.Transaction


{

    @Override
    protected void doTearDown() throws Exception
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        if (tx != null)
        {
            TransactionCoordination.getInstance().unbindTransaction(tx);
        }
    }
View Full Code Here


            {
                for (int i = 0; i < 100; i++)
                {
                    client.send("jms://test.queue", "Test Client Dispatch message " + i, props);
                }
                Transaction tx = TransactionCoordination.getInstance().getTransaction();
                assertNotNull(tx);
                tx.setRollbackOnly();
                return null;
            }
        });

        MuleMessage result = client.request("jms://replyTo.queue", 2000);
View Full Code Here

        if (ConnectionFactoryWrapper.logger.isDebugEnabled())
        {
            ConnectionFactoryWrapper.logger.debug("Invoking " + method);
        }
       
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
       
        if (method.getName().equals("createSession"))
        {
            if (tx != null)
            {
View Full Code Here

        mockPTM.expect("commit", C.same(mockTS.proxy()));

        SpringTransactionFactory factory = new SpringTransactionFactory();
        factory.setManager((PlatformTransactionManager)mockPTM.proxy());

        Transaction tx = factory.beginTransaction(muleContext);
//        TransactionCoordination.getInstance().bindTransaction(tx);
        tx.commit();
    }
View Full Code Here

        mockTS.expect("setRollbackOnly");

        SpringTransactionFactory factory = new SpringTransactionFactory();
        factory.setManager((PlatformTransactionManager)mockPTM.proxy());

        Transaction tx = factory.beginTransaction(muleContext);
//        TransactionCoordination.getInstance().bindTransaction(tx);
        tx.rollback();
    }
View Full Code Here

        super();
    }

    public Transaction beginTransaction(MuleContext muleContext) throws TransactionException
    {
        Transaction tx = new SpringTransaction(muleContext);
        tx.begin();
        return tx;
    }
View Full Code Here

     */
    protected void mayRollback() throws Exception
    {
        if (mayRollback)
        {
            Transaction tx = TransactionCoordination.getInstance().getTransaction();
            if (tx != null)
            {
                if (Math.random() < 0.3)
                {
                    log.info("Marking transaction for rollback");
                    tx.setRollbackOnly();
                }
            }
        }
    }
View Full Code Here

        if (logger.isDebugEnabled())
        {
            logger.debug("Enlistment request: " + this);
        }

        Transaction transaction = TransactionCoordination.getInstance().getTransaction();
        if (transaction == null)
        {
            throw new IllegalTransactionStateException(CoreMessages.noMuleTransactionAvailable());
        }
        if (!(transaction instanceof XaTransaction))
View Full Code Here

        if (logger.isDebugEnabled())
        {
            logger.debug("Delistment request: " + this);
        }

        Transaction transaction = TransactionCoordination.getInstance().getTransaction();
        if (transaction == null)
        {
            throw new IllegalTransactionStateException(CoreMessages.noMuleTransactionAvailable());
        }
        if (!(transaction instanceof XaTransaction))
View Full Code Here

        }
    }

    protected void commit()
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        if (tx != null)
        {
            try
            {
                tx.commit();
            }
            catch (TransactionException e)
            {
                logger.error(e);
            }
View Full Code Here

TOP

Related Classes of org.mule.api.transaction.Transaction

Copyright © 2018 www.massapicom. 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.