Package com.sun.messaging.bridge.service.jms.tx

Examples of com.sun.messaging.bridge.service.jms.tx.GlobalXid


    public void logHeuristicBranch(BranchXid bxid, LogRecord lr) throws Exception {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "jdbcTxLog: log branch heuristic decision  "+lr);
        }

        final GlobalXid gxid = lr.getGlobalXid();
        final BranchXid branchXid = bxid;
        final LogRecord newlr = lr;

    super.checkClosedAndSetInProgress();
        try {

        UpdateOpaqueDataCallback callback = new UpdateOpaqueDataCallback() {
                        
            public Object update(Object currlr) throws Exception {
                ObjectInputStream ois =  new ObjectInputStream(
                                         new ByteArrayInputStream((byte[])currlr));
                LogRecord oldlr = (LogRecord)ois.readObject();
                if (!oldlr.getGlobalXid().equals(gxid)) {
                    throw new IllegalArgumentException(
                    "Unexpected global xid "+oldlr.getGlobalXid()+" from store, expected:"+gxid);
                }
                ois.close();
                if (oldlr == null) {
                    throw new IllegalArgumentException(
                    "Unexpected null current log record for "+gxid);
                }
               
                if (oldlr.getBranchDecision(branchXid) ==
                    newlr.getBranchDecision(branchXid)) {
                    return currlr;
                }
                oldlr.setBranchDecision(branchXid, newlr.getBranchDecision(branchXid));
                return oldlr;
            }
        };
        _store.updateTMLogRecord(gxid.toString(), lr.toBytes(), _jmsbridge,
                                 callback, true, true, _logger);
        } finally {
        super.setInProgress(false);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.messaging.bridge.service.jms.tx.GlobalXid

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.