Package org.infinispan.persistence.spi
Interface TransactionalCacheWriter<K,V>
-
- All Superinterfaces:
AdvancedCacheWriter<K,V>
,CacheWriter<K,V>
,Lifecycle
@Deprecated public interface TransactionalCacheWriter<K,V> extends AdvancedCacheWriter<K,V>
Deprecated.since 11.0 replaced byNonBlockingStore
Defines the functionality of a transactional store. This interface allows the implementing store to participate in the 2PC protocol of a cache's transaction. This enables the cache transaction to be rolledback if an exception occurs whilst writing key changes to the underlying store, or for the writes to the underlying store to be rolledback if the exception occurs in-memory. As this writer is part of the 2PC, all writes to the underlying store should only be executed by the originator of a transaction in normal operation. In the event that the originator crashes between the prepare and commit/rollback phase it is expected that the underlying store's transaction will eventually timeout and rollback. In the event that the originator crashes and transaction recovery is enabled, then forcing commit will result in the replaying of said Tx's (prepare/commit) to the underlying store.- Since:
- 9.0
- Author:
- Ryan Emerson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
AdvancedCacheWriter.PurgeListener<K>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
commit(Transaction transaction)
Deprecated.Commit the provided transaction's changes to the underlying store.void
prepareWithModifications(Transaction transaction, org.infinispan.persistence.support.BatchModification batchModification)
Deprecated.Write modifications to the store in the prepare phase, as this is the only way we know the FINAL values of the entries.void
rollback(Transaction transaction)
Deprecated.Rollback the provided transaction's changes to the underlying store.-
Methods inherited from interface org.infinispan.persistence.spi.AdvancedCacheWriter
clear, purge
-
Methods inherited from interface org.infinispan.persistence.spi.CacheWriter
bulkUpdate, delete, deleteBatch, init, isAvailable, write
-
-
-
-
Method Detail
-
prepareWithModifications
void prepareWithModifications(Transaction transaction, org.infinispan.persistence.support.BatchModification batchModification) throws PersistenceException
Deprecated.Write modifications to the store in the prepare phase, as this is the only way we know the FINAL values of the entries. This is required to handle scenarios where an objects value is changed after the put command has been executed, but before the commit is called on the Tx.- Parameters:
transaction
- the current transactional context.batchModification
- an object containing the write/remove operations required for this transaction.- Throws:
PersistenceException
- if an error occurs when communicating/performing writes on the underlying store.
-
commit
void commit(Transaction transaction)
Deprecated.Commit the provided transaction's changes to the underlying store.- Parameters:
transaction
- the current transactional context.
-
rollback
void rollback(Transaction transaction)
Deprecated.Rollback the provided transaction's changes to the underlying store.- Parameters:
transaction
- the current transactional context.
-
-