/** * Roll back to the given savepoint. This is only allowed if the * transaction is open. * * @param savepointId the savepoint id */ public void rollbackToSavepoint(long savepointId) { checkNotClosed(); store.rollbackTo(this, logId, savepointId); logId = savepointId; }
/** * Prepare the transaction. Afterwards, the transaction can only be * committed or rolled back. */ public void prepare() { checkNotClosed(); status = STATUS_PREPARED; store.storeTransaction(this); }
/** * Roll the transaction back. Afterwards, this transaction is closed. */ public void rollback() { checkNotClosed(); store.rollbackTo(this, logId, 0); store.endTransaction(this); }
/** * Roll back to the given savepoint. This is only allowed if the * transaction is open. * * @param savepointId the savepoint id */ public void rollbackToSavepoint(long savepointId) { checkNotClosed(); store.rollbackTo(this, logId, savepointId); logId = savepointId; }
public void setName(String name) { checkNotClosed(); this.name = name; store.storeTransaction(this); }
/** * Commit the transaction. Afterwards, this transaction is closed. */ public void commit() { checkNotClosed(); store.commit(this, logId); }
/** * Prepare the transaction. Afterwards, the transaction can only be * committed or rolled back. */ public void prepare() { checkNotClosed(); status = STATUS_PREPARED; store.storeTransaction(this); }
/** * Commit the transaction. Afterwards, this transaction is closed. */ public void commit() { checkNotClosed(); store.commit(this, logId); }
private V set(K key, V value) { transaction.checkNotClosed(); V old = get(key); boolean ok = trySet(key, value, false); if (ok) { return old; } throw DataUtils.newIllegalStateException( DataUtils.ERROR_TRANSACTION_LOCKED, "Entry is locked"); }
public void setName(String name) { checkNotClosed(); this.name = name; store.storeTransaction(this); }
/** * Roll the transaction back. Afterwards, this transaction is closed. */ public void rollback() { checkNotClosed(); store.rollbackTo(this, logId, 0); store.endTransaction(this); }
private V set(K key, V value) { transaction.checkNotClosed(); V old = get(key); boolean ok = trySet(key, value, false); if (ok) { return old; } throw DataUtils.newIllegalStateException( DataUtils.ERROR_TRANSACTION_LOCKED, "Entry is locked"); }
/** * Open the map to store the data. * * @param <K> the key type * @param <V> the value type * @param name the name of the map * @param keyType the key data type * @param valueType the value data type * @return the transaction map */ public <K, V> TransactionMap<K, V> openMap(String name, DataType keyType, DataType valueType) { checkNotClosed(); MVMap<K, VersionedValue> map = store.openMap(name, keyType, valueType); int mapId = map.getId(); return new TransactionMap<>(this, map, mapId); }
/** * Open the transactional version of the given map. * * @param <K> the key type * @param <V> the value type * @param map the base map * @return the transactional map */ public <K, V> TransactionMap<K, V> openMap( MVMap<K, VersionedValue> map) { checkNotClosed(); int mapId = map.getId(); return new TransactionMap<>(this, map, mapId); }
/** * Commit the transaction. Afterwards, this transaction is closed. */ public void commit() { checkNotClosed(); store.commit(this, logId); }
/** * Prepare the transaction. Afterwards, the transaction can only be * committed or rolled back. */ public void prepare() { checkNotClosed(); status = STATUS_PREPARED; store.storeTransaction(this); }
/** * Roll the transaction back. Afterwards, this transaction is closed. */ public void rollback() { checkNotClosed(); store.rollbackTo(this, logId, 0); store.endTransaction(this, status); }
/** * Roll back to the given savepoint. This is only allowed if the * transaction is open. * * @param savepointId the savepoint id */ public void rollbackToSavepoint(long savepointId) { checkNotClosed(); store.rollbackTo(this, logId, savepointId); logId = savepointId; }
private V set(K key, V value) { transaction.checkNotClosed(); V old = get(key); boolean ok = trySet(key, value, false); if (ok) { return old; } throw DataUtils.newIllegalStateException( DataUtils.ERROR_TRANSACTION_LOCKED, "Entry is locked"); }
public void setName(String name) { checkNotClosed(); this.name = name; store.storeTransaction(this); }