Package com.arjuna.ats.internal.jta.resources.jts.orbspecific

Examples of com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord


      /*
       * Control and Coordinator should be set, or we would not have
       * gotten this far!
       */

      final XAResourceRecord res ;
                        if ((xaRes instanceof LastResourceCommitOptimisation) ||
                                ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE.isInstance(xaRes)))
                        {
                            if (lastResourceCount == 1)
                            {
                                if (jtaLogger.loggerI18N.isWarnEnabled())
                                {
                                    if (ALLOW_MULTIPLE_LAST_RESOURCES)
                                    {
                                        jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.lastResource.multipleWarning", new Object[] {xaRes});
                                    }
                                    else
                                    {
                                        jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.lastResource.disallow", new Object[] {xaRes});
                                    }
                                }
                            }

                            if ((lastResourceCount++ == 0) || ALLOW_MULTIPLE_LAST_RESOURCES)
                            {
                                res = new LastResourceRecord(this, xaRes, xid,
                                        params) ;
                            }
                            else
                            {
                                markRollbackOnly() ;
                                return false ;
                            }
                        }
                        else
                        {
                            res = new XAResourceRecord(this, xaRes, xid,
                                    params);
                        }

      RecoveryCoordinator recCoord = _theTransaction.registerResource(res.getResource());

      //      if (recCoord == null)
      //    throw new BAD_OPERATION();

      res.setRecoveryCoordinator(recCoord);

      return true;
    }
    catch (Exception e)
    {
View Full Code Here


                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
View Full Code Here

     * @param xid
     * @return
     */
    private XAResourceRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
    {
        final XAResourceRecord record;
        if ((xaRes instanceof LastResourceCommitOptimisation)
                || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
                .isInstance(xaRes)))
        {
            if (lastResourceCount == 1)
            {
                if (jtaLogger.loggerI18N.isWarnEnabled())
                {
                    if (ALLOW_MULTIPLE_LAST_RESOURCES)
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning",
                                        new Object[]
                                                { xaRes });
                    }
                    else
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow",
                                        new Object[]
                                                { xaRes });
                    }
                }
            }

            if ((lastResourceCount++ == 0) || ALLOW_MULTIPLE_LAST_RESOURCES)
            {
                record = new LastResourceRecord(this, xaRes, xid, params);
            }
            else
            {
                record = null;
            }
        }
        else
        {
            record = new XAResourceRecord(this, xaRes, xid, params);
        }

        return record;
    }
View Full Code Here

                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
View Full Code Here

     * @param xid
     * @return
     */
    private XAResourceRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
    {
        final XAResourceRecord record;
        if ((xaRes instanceof LastResourceCommitOptimisation)
                || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
                .isInstance(xaRes)))
        {
            if (lastResourceCount == 1)
            {
                if (jtaLogger.loggerI18N.isWarnEnabled())
                {
                    if (ALLOW_MULTIPLE_LAST_RESOURCES)
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning",
                                        new Object[]
                                                { xaRes });
                    }
                    else
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow",
                                        new Object[]
                                                { xaRes });
                    }
                }
            }

            if ((lastResourceCount++ == 0) || ALLOW_MULTIPLE_LAST_RESOURCES)
            {
                record = new LastResourceRecord(this, xaRes, xid, params);
            }
            else
            {
                record = null;
            }
        }
        else
        {
            record = new XAResourceRecord(this, xaRes, xid, params);
        }

        return record;
    }
View Full Code Here

                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
View Full Code Here

     * @param xid
     * @return
     */
    private XAResourceRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
    {
        final XAResourceRecord record;
        if ((xaRes instanceof LastResourceCommitOptimisation)
                || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
                .isInstance(xaRes)))
        {
            if (lastResourceCount == 1)
            {
                if (jtaLogger.loggerI18N.isWarnEnabled())
                {
                    if (ALLOW_MULTIPLE_LAST_RESOURCES)
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning",
                                        new Object[]
                                                { xaRes });
                    }
                    else
                    {
                        jtaLogger.loggerI18N
                                .warn(
                                        "com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow",
                                        new Object[]
                                                { xaRes });
                    }
                }
            }

            if ((lastResourceCount++ == 0) || ALLOW_MULTIPLE_LAST_RESOURCES)
            {
                record = new LastResourceRecord(this, xaRes, xid, params);
            }
            else
            {
                record = null;
            }
        }
        else
        {
            record = new XAResourceRecord(this, xaRes, xid, params);
        }

        return record;
    }
View Full Code Here

                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The registerResource will fail in the case of multiple last resources being disallowed.
                        // see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
View Full Code Here

     * @param xid
     * @return
     */
    private XAResourceRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
    {
        final XAResourceRecord record;
        if ((xaRes instanceof LastResourceCommitOptimisation)
                || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
                .isInstance(xaRes)))
        {
                record = new LastResourceRecord(this, xaRes, xid, params);
        }
        else
        {
            record = new XAResourceRecord(this, xaRes, xid, params);
        }

        return record;
    }
View Full Code Here

                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
View Full Code Here

TOP

Related Classes of com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord

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.