com.sap.tc.mobile.session.api
Interface Subtransaction


public interface Subtransaction

Subtransaction interface. Usage example:

        Subtransaction sub = session.openSubtrans();
        try {
                // do a number of operations
                ...
                // as a last step, do commit to confirm the changes
                sub.commit();
        } finally {
                // release subtrans, which rolls back the changes, unless
                // commit confirmed the changes
                sub.release();
        }
 
This pattern will make all the operations within try/finally atomic. When an error occurs, the subtransaction will be rolled back, otherwise it will be committed.

Author:
d039184

Method Summary
 void commit()
          Mark the subtransaction for commit.
 void release()
          Release the subtransaction.
 

Method Detail

commit

void commit()
Mark the subtransaction for commit. Any changes made by the subtransaction are confirmed. Actual subtrans commit happens when releasing subtransaction object.

See Also:
release()

release

void release()
Release the subtransaction. This confirms or roll backs the changes made by this subtransaction and invalidates the subtransaction object. Changes are confirmed only if a commit() call has been called on the subtrans before release().

See Also:
commit()