Search in sources :

Example 1 with DistributedTransaction

use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.

the class ServerSession method endDtx.

public void endDtx(Xid xid, boolean fail, boolean suspend) throws NotAssociatedDtxException, UnknownDtxBranchException, DtxNotSelectedException, SuspendAndFailDtxException, TimeoutDtxException {
    DistributedTransaction distributedTransaction = assertDtxTransaction();
    distributedTransaction.end(toDtxXid(xid), fail, suspend);
}
Also used : DistributedTransaction(org.apache.qpid.server.txn.DistributedTransaction)

Example 2 with DistributedTransaction

use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.

the class ServerSession method startDtx.

public void startDtx(Xid xid, boolean join, boolean resume) throws JoinAndResumeDtxException, UnknownDtxBranchException, AlreadyKnownDtxException, DtxNotSelectedException {
    DistributedTransaction distributedTransaction = assertDtxTransaction();
    distributedTransaction.start(toDtxXid(xid), join, resume);
}
Also used : DistributedTransaction(org.apache.qpid.server.txn.DistributedTransaction)

Example 3 with DistributedTransaction

use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.

the class ServerSession method onClose.

public void onClose() {
    AMQPConnection_0_10 amqpConnection = getAMQPConnection();
    if (_transaction instanceof LocalTransaction) {
        if (((LocalTransaction) _transaction).hasOutstandingWork()) {
            amqpConnection.incrementTransactionRollbackCounter();
        }
        amqpConnection.decrementTransactionOpenCounter();
        _transaction.rollback();
        amqpConnection.unregisterTransactionTickers(_transaction);
    } else if (_transaction instanceof DistributedTransaction) {
        getAddressSpace().getDtxRegistry().endAssociations(_modelObject);
    }
    for (MessageDispositionChangeListener listener : _messageDispositionListenerMap.values()) {
        listener.onRelease(true, true);
    }
    _messageDispositionListenerMap.clear();
    for (Action<? super Session_0_10> task : _modelObject.getTaskList()) {
        task.performAction(_modelObject);
    }
    LogMessage operationalLoggingMessage = _forcedCloseLogMessage.get();
    if (operationalLoggingMessage == null && getConnection().getConnectionCloseMessage() != null) {
        operationalLoggingMessage = ChannelMessages.CLOSE_FORCED(getConnection().getConnectionCloseCode(), getConnection().getConnectionCloseMessage());
    }
    if (operationalLoggingMessage == null) {
        operationalLoggingMessage = ChannelMessages.CLOSE();
    }
    amqpConnection.getEventLogger().message(getLogSubject(), operationalLoggingMessage);
}
Also used : DistributedTransaction(org.apache.qpid.server.txn.DistributedTransaction) LocalTransaction(org.apache.qpid.server.txn.LocalTransaction) LogMessage(org.apache.qpid.server.logging.LogMessage)

Aggregations

DistributedTransaction (org.apache.qpid.server.txn.DistributedTransaction)3 LogMessage (org.apache.qpid.server.logging.LogMessage)1 LocalTransaction (org.apache.qpid.server.txn.LocalTransaction)1