|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TransactionManager is the entry point for application driven transaction management
based on SyncBos. An instance of this class could be retrieved by calling the
getSmartSyncTransactionManager()
method on class SyncBoDataFacade
.
With this manager the application itselfs can decide when to start, commit
or rollback a transaction. Only one transaction is supported at one time.
Applications must complete (commit or rollback) an open transaction before syncronization.
Otherwise the MI framework roll back the current transaction as default.
Only linked SyncBos can get involved in a Smart Sync transaction. This means modifications
on SyncBos in status "INITIAL" or "UNLINKED" can not be part of a transaction.
SmartSyncTransactionManger smartSyncTransactionManger = SyncBoDataFacade.getSmartSyncTransactionManger();
smartSyncTransactionManager.beginTransaction();
SyncBo newSyncBo = syncBoDataFacade.createEmptySyncBo(syncBoDescriptor);
syncBoDataFacade.insertSyncBo(newSyncBo);
newSyncBo.insertRow(row);
smartSyncTransactionManager.rollback();
After rollback, all the repository instances, including SyncBo and Row, must be retrieved again.
SyncBoDataFacade.getSmartSyncTransactionManager()
,
StatusType
Method Summary | |
void |
beginTransaction()
Set the start point for a transaction. |
void |
commit()
Commit the pending transaction. |
boolean |
hasSyncBoChanged()
Test if there has been a moficaction on a SyncBo/Row/Field in the current transaction. |
boolean |
isTransactionStarted()
Checks if there is an open transaction. |
void |
rollback()
Rollback the pending transaction. |
Method Detail |
public void beginTransaction() throws SmartSyncException, PersistenceException
SmartSyncException
- if there is already an open application transaction.
PersistenceException
- if the transaction could not be opened for technical
reasons.public void commit() throws SmartSyncException, PersistenceException
SmartSyncException
- if there is no open transaction to commit.
PersistenceException
- if the transaction could not be commited because of
technical reasons.public void rollback() throws SmartSyncException, PersistenceException
SmartSyncException
- if there is no open transaction to rollback.
PersistenceException
- if the transaction could not be rollbacked because of
technical reasons.public boolean hasSyncBoChanged()
public boolean isTransactionStarted()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |