com.sap.ip.me.api.smartsync
Interface SmartSyncTransactionManager


public interface SmartSyncTransactionManager

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.

Example:

note

After rollback, all the repository instances, including SyncBo and Row, must be retrieved again.

Since:
2.5
Author:
SAP AG
See Also:
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

beginTransaction

public void beginTransaction()
                      throws SmartSyncException,
                             PersistenceException
Set the start point for a transaction.

Throws:
SmartSyncException - if there is already an open application transaction.
PersistenceException - if the transaction could not be opened for technical reasons.

commit

public void commit()
            throws SmartSyncException,
                   PersistenceException
Commit the pending transaction.

Throws:
SmartSyncException - if there is no open transaction to commit.
PersistenceException - if the transaction could not be commited because of technical reasons.

rollback

public void rollback()
              throws SmartSyncException,
                     PersistenceException
Rollback the pending transaction.

Throws:
SmartSyncException - if there is no open transaction to rollback.
PersistenceException - if the transaction could not be rollbacked because of technical reasons.

hasSyncBoChanged

public boolean hasSyncBoChanged()
Test if there has been a moficaction on a SyncBo/Row/Field in the current transaction.

Returns:
true if there had been a modifcation. Otherwise false. If there is no pending transaction it returns false.

isTransactionStarted

public boolean isTransactionStarted()
Checks if there is an open transaction.

Returns:
true if there is an open transaction, otherwise false.


Copyright © 2005 SAP AG. All Rights Reserved.