use of com.swiftmq.swiftlet.store.StoreException in project swiftmq-ce by iitsoftware.
the class NonPersistentStoreImpl method insert.
public void insert(StoreEntry storeEntry) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/insert, storeEntry=" + storeEntry);
try {
checkSwapFile();
SwapAddress sa = new SwapAddress();
sa.swapFile = actSwapFile;
sa.filePointer = sa.swapFile.add(storeEntry);
storeEntry.key = sa;
} catch (Exception e) {
throw new StoreException(e.getMessage());
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/insert done, storeEntry=" + storeEntry);
}
use of com.swiftmq.swiftlet.store.StoreException in project swiftmq-ce by iitsoftware.
the class StoreReadTransactionImpl method commit.
public void commit(XidImpl globalTxId) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit, globalTxId: " + globalTxId);
try {
ctx.preparedLog.remove(prepareLogRecord);
commit();
} catch (IOException e) {
throw new StoreException(e.toString());
}
prepareLogRecord = null;
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit, globalTxId: " + globalTxId + ", done");
}
use of com.swiftmq.swiftlet.store.StoreException in project swiftmq-ce by iitsoftware.
the class StoreReadTransactionImpl method commit.
public void commit() throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit...");
if (closed)
throw new StoreException("Transaction is closed");
txId = ctx.transactionManager.createTxId();
journal = new ArrayList();
queueIndex.setJournal(journal);
try {
for (int i = 0; i < keys.size(); i++) {
addMessagePageReference(queueIndex.remove((QueueIndexEntry) keys.get(i)));
}
} catch (Exception e) {
e.printStackTrace();
throw new StoreException(e.getMessage());
}
keys.clear();
super.commit();
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit...done.");
}
use of com.swiftmq.swiftlet.store.StoreException 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");
}
use of com.swiftmq.swiftlet.store.StoreException in project swiftmq-ce by iitsoftware.
the class StoreWriteTransactionImpl method commit.
public void commit(XidImpl globalTxId) throws StoreException {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit, globalTxId: " + globalTxId);
try {
ctx.preparedLog.remove(prepareLogRecord);
} catch (IOException e) {
throw new StoreException(e.toString());
}
prepareLogRecord = null;
close();
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/commit, globalTxId: " + globalTxId + ", done");
}
Aggregations