Search in sources :

Example 1 with PrepareLogRecordImpl

use of com.swiftmq.impl.store.standard.xa.PrepareLogRecordImpl in project swiftmq-ce by iitsoftware.

the class StoreReadTransactionImpl method prepare.

public void prepare(XidImpl globalTxId) throws StoreException {
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace("sys$store", toString() + "/prepare, globalTxId=" + globalTxId);
    try {
        prepareLogRecord = new PrepareLogRecordImpl(PrepareLogRecordImpl.READ_TRANSACTION, queueName, globalTxId, keys);
        ctx.preparedLog.add(prepareLogRecord);
    } catch (IOException e) {
        throw new StoreException(e.getMessage());
    }
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace("sys$store", toString() + "/prepare, globalTxId=" + globalTxId + ", done");
}
Also used : PrepareLogRecordImpl(com.swiftmq.impl.store.standard.xa.PrepareLogRecordImpl) IOException(java.io.IOException) StoreException(com.swiftmq.swiftlet.store.StoreException)

Example 2 with PrepareLogRecordImpl

use of com.swiftmq.impl.store.standard.xa.PrepareLogRecordImpl in project swiftmq-ce by iitsoftware.

the class StoreWriteTransactionImpl method prepare.

public void prepare(XidImpl globalTxId) throws StoreException {
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace("sys$store", toString() + "/prepare, globalTxId=" + globalTxId);
    try {
        prepareLogRecord = new PrepareLogRecordImpl(PrepareLogRecordImpl.WRITE_TRANSACTION, queueName, globalTxId, keys);
        ctx.preparedLog.add(prepareLogRecord);
        ctx.recoveryManager.commit(new CommitLogRecord(txId, sem, journal, this, null));
        sem.waitHere();
        ctx.transactionManager.removeTxId(txId);
    } catch (Exception e) {
        throw new StoreException(e.getMessage());
    }
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace("sys$store", toString() + "/prepare, globalTxId=" + globalTxId + ", done");
}
Also used : CommitLogRecord(com.swiftmq.impl.store.standard.log.CommitLogRecord) PrepareLogRecordImpl(com.swiftmq.impl.store.standard.xa.PrepareLogRecordImpl) StoreException(com.swiftmq.swiftlet.store.StoreException) IOException(java.io.IOException) StoreException(com.swiftmq.swiftlet.store.StoreException)

Aggregations

PrepareLogRecordImpl (com.swiftmq.impl.store.standard.xa.PrepareLogRecordImpl)2 StoreException (com.swiftmq.swiftlet.store.StoreException)2 IOException (java.io.IOException)2 CommitLogRecord (com.swiftmq.impl.store.standard.log.CommitLogRecord)1