public interface Coordinator
Coordinator is a transaction coordinator for "Two-phase commit protocol".
Coordinator is instantiated by Session when a
transaction is started and every transactional operation is forwarded to the
coordinator. If multiple entities are updated (also, inserted and deleted) in
a transaction, the coordinator has to make multiple ResourceManagers
manage them and commit these operations atomically by
Two-phase commit protocol.| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits every operation in the current transaction with Two-phase commit
protocol.
|
void |
delete(Object entity)
Deletes entity instance in the current transaction.
|
<E> E |
get(Class<E> clazz,
Object key)
Gets entity instance of the specified
Class corresponding to the
specified id in the current transaction. |
void |
put(Object entity)
Puts entity instance in the current transaction.
|
void |
rollback()
Rolls back every operation in the current transaction.
|
void |
update(Object entity)
Updates entity instance in the current transaction.
|
<E> E get(Class<E> clazz, Object key)
Class corresponding to the
specified id in the current transaction.E - The type of entity.clazz - The Class of entity.key - The key of the entity.Class corresponding to
the specified entity id.void put(Object entity)
entity - The entity to be put into datastore.void update(Object entity)
entity - The entity to be updated.void delete(Object entity)
entity - The entity to be deleted.void commit()
throws IndoubtException
IndoubtException - If the data consistency is broken.void rollback()
Copyright © 2009-2014 Eiichiro Uchiumi. All Rights Reserved.