Package bitronix.tm.recovery

Examples of bitronix.tm.recovery.RecoveryException


    /* XAResourceProducer implementation */

    public XAResourceHolderState startRecovery() throws RecoveryException {
        init();
        if (recoveryConnectionHandle != null)
            throw new RecoveryException("recovery already in progress on " + this);

        try {
            recoveryConnectionHandle = (Connection) pool.getConnectionHandle(false);
            PooledConnectionProxy pooledConnection = (PooledConnectionProxy) recoveryConnectionHandle;
            recoveryXAResourceHolder = pooledConnection.getPooledConnection().createRecoveryXAResourceHolder();
            return new XAResourceHolderState(pooledConnection.getPooledConnection(), this);
        } catch (Exception ex) {
            throw new RecoveryException("cannot start recovery on " + this, ex);
        }
    }
View Full Code Here


        try {
            if (log.isDebugEnabled()) { log.debug("recovery xa resource is being closed: " + recoveryXAResourceHolder); }
            recoveryConnectionHandle.close();
        } catch (Exception ex) {
            throw new RecoveryException("error ending recovery on " + this, ex);
        }
        finally {
            recoveryConnectionHandle = null;

            // the recoveryXAResourceHolder actually wraps the recoveryConnectionHandle so closing it
View Full Code Here

    }

    @Test
    public void testNonRecoverableProducersAreNotRegistered() throws Exception {
        final XAResourceProducer producer = createMockProducer("non-recoverable");
        when(producer.startRecovery()).thenThrow(new RecoveryException("recovery not possible"));

        try {
            ResourceRegistrar.register(producer);
            fail("expecting RecoveryException");
        } catch (RecoveryException e) {
View Full Code Here

TOP

Related Classes of bitronix.tm.recovery.RecoveryException

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.