Examples of XAResourceHolderState


Examples of bitronix.tm.internal.XAResourceHolderState

            return preparedResources;
        }

        // 1PC optimization
        if (resourceManager.size() == 1) {
            XAResourceHolderState resourceHolder = resourceManager.getAllResources().get(0);

            preparedResources.add(resourceHolder);
            if (log.isDebugEnabled()) { log.debug("1 resource enlisted, no prepare needed (1PC)"); }
            transaction.setStatus(Status.STATUS_PREPARED);
            return preparedResources;
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

        List<XAResourceHolderState> heuristicResources = new ArrayList<XAResourceHolderState>();
        List<XAResourceHolderState> errorResources = new ArrayList<XAResourceHolderState>();

        for (int i = 0; i < exceptions.size(); i++) {
            Exception ex = exceptions.get(i);
            XAResourceHolderState resourceHolder = resources.get(i);
            if (ex instanceof XAException) {
                XAException xaEx = (XAException) ex;
                /**
                 * Sybase ASE can sometimes forget a transaction before prepare. For instance, when executing
                 * a stored procedure that contains a rollback statement. In that case it throws XAException(XAER_NOTA)
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

            super(resourceHolder);
        }

        public void execute() {
            try {
                XAResourceHolderState resourceHolder = getResource();
                if (log.isDebugEnabled()) { log.debug("preparing resource " + resourceHolder); }

                int vote = resourceHolder.getXAResource().prepare(resourceHolder.getXid());
                if (vote != XAResource.XA_RDONLY) {
                    preparedResources.add(resourceHolder);
                }

                if (log.isDebugEnabled()) { log.debug("prepared resource " + resourceHolder + " voted " + Decoder.decodePrepareVote(vote)); }
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

        List<XAResourceHolderState> heuristicResources = new ArrayList<XAResourceHolderState>();
        List<XAResourceHolderState> errorResources = new ArrayList<XAResourceHolderState>();

        for (int i = 0; i < exceptions.size(); i++) {
            Exception ex = exceptions.get(i);
            XAResourceHolderState resourceHolder = resources.get(i);
            if (ex instanceof XAException) {
                XAException xaEx = (XAException) ex;
                switch (xaEx.errorCode) {
                    case XAException.XA_HEURHAZ:
                        hazard = true;
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

        errorMessage.append(" exception(s):");
        for (int i = 0; i < exceptions.size(); i++) {
            errorMessage.append(System.getProperty("line.separator"));
            Throwable throwable = exceptions.get(i);
            String message = throwable.getMessage();
            XAResourceHolderState holderState = resourceStates.get(i);

            if (holderState != null) {
                errorMessage.append(" [");
                errorMessage.append(holderState.getUniqueName());
                errorMessage.append(" - ");
            }
            errorMessage.append(throwable.getClass().getName());
            if (throwable instanceof XAException) {
                XAException xaEx = (XAException) throwable;
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

            if (currentTransaction.timedOut())
                throw new BitronixSystemException("transaction timed out");

            // in case multiple unjoined branches of the current transaction have run on the resource,
            // only the last one counts as all the first ones are ended already
            XAResourceHolderState alreadyEnlistedXAResourceHolderState = TransactionContextHelper.getLatestAlreadyEnlistedXAResourceHolderState(xaResourceHolder, currentTransaction);
            if (alreadyEnlistedXAResourceHolderState == null || alreadyEnlistedXAResourceHolderState.isEnded()) {
                currentTransaction.enlistResource(xaResourceHolder.getXAResource());
            }
            else if (log.isDebugEnabled()) { log.debug("avoiding re-enlistment of already enlisted but not ended resource " + alreadyEnlistedXAResourceHolderState); }
        }
        else {
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

            if (statesForGtrid == null) {
                log.warn("tried to remove unknown GTRID [" + gtrid + "] from " + this + " - Bug?");
                return;
            }

            XAResourceHolderState removed = statesForGtrid.remove(bqual);
            if (removed == null) {
                log.warn("tried to remove unknown BQUAL [" + bqual + "] from " + this + " - Bug?");
                return;
            }
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

    public static void recover(XAResourceProducer xaResourceProducer) throws RecoveryException {
        String uniqueName = xaResourceProducer.getUniqueName();
        if (log.isDebugEnabled()) { log.debug("start of incremental recovery on resource " + uniqueName); }

        try {
            XAResourceHolderState xaResourceHolderState = xaResourceProducer.startRecovery();
            boolean success = true;
            Set<BitronixXid> xids = RecoveryHelper.recover(xaResourceHolderState);
            if (log.isDebugEnabled()) { log.debug(xids.size() + " dangling transaction(s) found on resource"); }
            Map<?, ?> danglingRecords = TransactionManagerServices.getJournal().collectDanglingRecords();
            if (log.isDebugEnabled()) { log.debug(danglingRecords.size() + " dangling transaction(s) found in journal"); }
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

        StringBuilder sb = new StringBuilder();
        sb.append("[");

        Iterator<XAResourceHolderState> it = resources.iterator();
        while (it.hasNext()) {
            XAResourceHolderState resourceHolderState = it.next();
            sb.append(resourceHolderState.getUniqueName());

            if (it.hasNext())
                sb.append(", ");
        }
View Full Code Here

Examples of bitronix.tm.internal.XAResourceHolderState

        if (producer == null)
            throw new IllegalArgumentException("recoverable resource cannot be null");

        try {
            if (log.isDebugEnabled()) { log.debug("running recovery on " + producer); }
            XAResourceHolderState xaResourceHolderState = producer.startRecovery();
            return RecoveryHelper.recover(xaResourceHolderState);
        } finally {
            producer.endRecovery();
        }
    }
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.