@Override public RuntimeException create(Throwable throwable, String message) { return new TransactionException(message, throwable); } };
@Override public Throwable createException(String message, Throwable cause) { return new TransactionException(message, cause); } });
public void ensureReserve(long itemId) { if (txMap.get(itemId) == null) { throw new TransactionException("Transaction reservation cannot be found for reservation item ID: " + itemId); } }
public void ensureReserve(long itemId) { if (txMap.get(itemId) == null) { throw new TransactionException("Transaction reservation cannot be found for reservation item ID: " + itemId); } }
private void createBackupLog(String callerUuid, String txnId, boolean allowedDuringPassiveState) { TxBackupLog log = new TxBackupLog(Collections.<TransactionLogRecord>emptyList(), callerUuid, ACTIVE, -1, -1, allowedDuringPassiveState); if (txBackupLogs.putIfAbsent(txnId, log) != null) { throw new TransactionException("TxLog already exists!"); } }
private void checkTimeout() throws TransactionException { if (startTime + timeoutMillis < currentTimeMillis()) { throw new TransactionException("Transaction is timed-out!"); } }
public void commitAdd(long itemId, Data value) { final TxCollectionItem txItem = txMap.remove(itemId); if (txItem == null) { throw new TransactionException("Transaction log cannot be found for committing 'add()' operation." + " Missing log item ID: " + itemId); } CollectionItem item = new CollectionItem(itemId, value); getCollection().add(item); }
@Override public void innerBeforeRun() throws Exception { super.innerBeforeRun(); if (!recordStore.canAcquireLock(dataKey, ownerUuid, threadId)) { throw new TransactionException("Cannot acquire lock UUID: " + ownerUuid + ", threadId: " + threadId); } }
@Override public void innerBeforeRun() throws Exception { super.innerBeforeRun(); if (!recordStore.canAcquireLock(dataKey, ownerUuid, threadId)) { throw new TransactionException("Cannot acquire lock UUID: " + ownerUuid + ", threadId: " + threadId); } }
@Override public void innerBeforeRun() throws Exception { super.innerBeforeRun(); if (!recordStore.canAcquireLock(dataKey, ownerUuid, threadId)) { throw new TransactionException("Cannot acquire lock UUID: " + ownerUuid + ", threadId: " + threadId); } }
public void reserveRemoveBackup(long itemId, String transactionId) { final CollectionItem item = getMap().remove(itemId); if (item == null) { throw new TransactionException("Transaction reservation failed on backup member. " + "Reservation item ID: " + itemId); } txMap.put(itemId, new TxCollectionItem(item).setTransactionId(transactionId).setRemoveOperation(true)); }
public TransactionContextProxy(ClientTransactionManagerServiceImpl transactionManager, TransactionOptions options) { this.transactionManager = transactionManager; this.client = transactionManager.getClient(); try { connection = transactionManager.connect(); } catch (Exception e) { throw new TransactionException("Could not obtain a connection!", e); } this.transaction = new TransactionProxy(client, options, connection); }
@Override protected Object call() throws Exception { String transactionId = parameters.transactionId; TransactionContext transactionContext = endpoint.getTransactionContext(transactionId); if (transactionContext == null) { throw new TransactionException("No transaction context with given transactionId: " + transactionId); } Transaction transaction = TransactionAccessor.getTransaction(transactionContext); transaction.prepare(); return null; }
@Override public void run() throws Exception { MultiMapContainer container = getOrCreateContainerWithoutAccess(); if (!container.txnLock(dataKey, caller, threadId, getCallId(), LOCK_EXTENSION_TIME_IN_MILLIS, true)) { throw new TransactionException( "Lock is not owned by the transaction! -> " + container.getLockOwnerInfo(dataKey) ); } }
@Override public void run() throws Exception { MultiMapContainer container = getOrCreateContainerWithoutAccess(); if (container.isLocked(dataKey) && !container.unlock(dataKey, caller, threadId, getCallId())) { throw new TransactionException("Lock is not owned by the transaction! -> " + container.getLockOwnerInfo(dataKey)); } }
@Override public void run() throws Exception { MultiMapContainer container = getOrCreateContainer(); if (container.isLocked(dataKey) && !container.unlock(dataKey, getCallerUuid(), threadId, getCallId())) { throw new TransactionException( "Lock is not owned by the transaction! Owner: " + container.getLockOwnerInfo(dataKey) ); } }
@Override public void run() throws Exception { if (recordStore.isLocked(getKey()) && !recordStore.unlock(getKey(), lockOwner, lockThreadId, getCallId())) { throw new TransactionException("Lock is not owned by the transaction! Owner: " + recordStore.getLockOwnerInfo(getKey())); } }
@Override public void run() throws Exception { if (recordStore.isLocked(getKey()) && !recordStore.unlock(getKey(), lockOwner, lockThreadId, getCallId())) { throw new TransactionException("Lock is not owned by the transaction! Owner: " + recordStore.getLockOwnerInfo(getKey())); } }
@Override public void run() throws Exception { if (!recordStore.extendLock(getKey(), ownerUuid, getThreadId(), LOCK_TTL_MILLIS)) { ILogger logger = getLogger(); if (logger.isFinestEnabled()) { logger.finest("Locked: [" + recordStore.isLocked(getKey()) + "], key: [" + getKey() + ']'); } throw new TransactionException("Lock is not owned by the transaction! [" + recordStore.getLockOwnerInfo(getKey()) + ']'); } }
@Override public void run() throws Exception { if (!recordStore.txnLock(getKey(), ownerUuid, getThreadId(), getCallId(), ttl, blockReads)) { throw new TransactionException("Transaction couldn't obtain lock."); } Record record = recordStore.getRecordOrNull(dataKey); if (record == null && shouldLoad) { record = recordStore.loadRecordOrNull(dataKey, false, getCallerAddress()); } Data value = record == null ? null : mapServiceContext.toData(record.getValue()); response = new VersionedValue(value, record == null ? 0 : record.getVersion()); }