Examples of TransactionId


Examples of com.sun.sgs.impl.profile.util.TransactionId

  if (detail == null) {
            return;
        }

        // if a backlog is in use, then store the new detail
        TransactionId txnId = null;
        if (backlogMap != null) {
            txnId = new TransactionId(profileReport.getTransactionId());
            backlogMap.put(txnId, detail);
        }

        // if there was conflict, then figure out what to display
        if (detail.getConflictType() != ConflictType.NONE) {
            if (txnId == null) {
                txnId = new TransactionId(profileReport.getTransactionId());
            }
            // print out the detail for the failed transaction
      System.out.printf("Task type %s failed due to conflict.  Details:"
            + "%n  accessor id: %s, try count %d; objects "
            + "accessed ordered by first access:%n%s"
            + "conflict type: %s%n",
            profileReport.getTask().getBaseTaskType(),
            txnId, profileReport.getRetryCount(),
            formatAccesses(detail.getAccessedObjects()),
            detail.getConflictType());

            // see if the conflicting transaction is known, otherwise we've
            // shown all the detail we know
            byte [] conflictingBytes = detail.getConflictingId();
            if (conflictingBytes == null) {
                System.out.printf("%n");
                return;
            }

            TransactionId conflictingId = new TransactionId(conflictingBytes);

            // if we're keeping a backlog, look through it to see if we
            // have the detail on the conflicting id
            if (backlogMap != null) {
                // look to see if we know about the conflicting transaction,
View Full Code Here

Examples of com.taobao.metamorphosis.transaction.TransactionId

public class TransactionCommandUnitTest {

    @Test
    public void testEncode() {
        final TransactionId id = new LocalTransactionId("sessionId", 99);
        final TransactionInfo info = new TransactionInfo(id, "sessionId", TransactionType.COMMIT_ONE_PHASE, null);

        final TransactionCommand cmd = new TransactionCommand(info, 100);
        final IoBuffer buf = cmd.encode();
        assertEquals("transaction TX:sessionId:99 sessionId COMMIT_ONE_PHASE 100\r\n", new String(buf.array()));
View Full Code Here

Examples of net.sf.ehcache.transaction.TransactionID

    /**
     * Begin a new transaction with the specified timeout and bind its context to the current thread
     * @param transactionTimeoutSeconds the timeout foe this transaction in seconds
     */
    public void begin(int transactionTimeoutSeconds) {
        TransactionID txId = currentTransactionIdThreadLocal.get();
        if (txId != null) {
            throw new TransactionException("transaction already started");
        }

        LocalTransactionContext newTx = new LocalTransactionContext(transactionTimeoutSeconds, transactionIDFactory.createTransactionID());
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

    public Map<TransactionId, AMQTx> retrievePreparedState() throws IOException {
        Map<TransactionId, AMQTx> result = new HashMap<TransactionId, AMQTx>();
        preparedTransactions.load();
        for (Iterator<TransactionId> i = preparedTransactions.keySet().iterator(); i.hasNext();) {
            TransactionId key = i.next();
            AMQTx value = preparedTransactions.get(key);
            result.put(key, value);
        }
        return result;
    }
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

        MessageId id = new MessageId(producerId, messageIdGenerator.getNextSequenceId());
        message.setMessageId(id);
        message.setJMSTimestamp(System.currentTimeMillis());

        if (stompTx != null) {
            TransactionId activemqTx = transactions.get(stompTx);
            if (activemqTx == null) {
                throw new ProtocolException("Invalid transaction id: " + stompTx);
            }
            message.setTransactionId(activemqTx);
        }
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

        String messageId = headers.get(Stomp.Headers.Ack.MESSAGE_ID);
        if (messageId == null) {
            throw new ProtocolException("ACK received without a message-id to acknowledge!");
        }

        TransactionId activemqTx = null;
        String stompTx = headers.get(Stomp.Headers.TRANSACTION);
        if (stompTx != null) {
            activemqTx = transactions.get(stompTx);
            if (activemqTx == null) {
                throw new ProtocolException("Invalid transaction id: " + stompTx);
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

        String stompTx = headers.get(Stomp.Headers.TRANSACTION);
        if (stompTx == null) {
            throw new ProtocolException("Must specify the transaction you are committing");
        }

        TransactionId activemqTx = transactions.remove(stompTx);
        if (activemqTx == null) {
            throw new ProtocolException("Invalid transaction id: " + stompTx);
        }

        TransactionInfo tx = new TransactionInfo();
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

        String stompTx = headers.get(Stomp.Headers.TRANSACTION);
        if (stompTx == null) {
            throw new ProtocolException("Must specify the transaction you are committing");
        }

        TransactionId activemqTx = transactions.remove(stompTx);
        if (activemqTx == null) {
            throw new ProtocolException("Invalid transaction id: " + stompTx);
        }

        TransactionInfo tx = new TransactionInfo();
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

            this.indexLock.writeLock().unlock();
        }
    }

    protected void process(KahaCommitCommand command, Location location) throws IOException {
        TransactionId key = key(command.getTransactionInfo());
        List<Operation> inflightTx;
        synchronized (inflightTransactions) {
            inflightTx = inflightTransactions.remove(key);
            if (inflightTx == null) {
                inflightTx = preparedTransactions.remove(key);
View Full Code Here

Examples of org.apache.activemq.command.TransactionId

            this.indexLock.writeLock().unlock();
        }
    }

    protected void process(KahaPrepareCommand command, Location location) {
        TransactionId key = key(command.getTransactionInfo());
        synchronized (inflightTransactions) {
            List<Operation> tx = inflightTransactions.remove(key);
            if (tx != null) {
                preparedTransactions.put(key, tx);
            }
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.