You are on page 1of 1

TRANSACTION SERVICE ---> used for managing OO transactions

The main use of this is we can mark the begin of and end of OO transaction, so
that we can either save (commit) the complete transaction or cancel (rollback) the
complete transaction. As part of this transaction service, we use the following
class and interfaces.

1. cl_os_system --> class

2. if_os_transaction

3. if_os_transaction_manager

Persistence class--> zcl_emp actor/agent class --> zca_emp

base agent class --> zcb_emp.

Procedure for using Transaction service:

1. Get the transaction manager object: This is done by calling the static method
'get_transaction_manager' of the class 'cl_os_system'

2. Using the above transaction manager object, get the transaction object. This is
done by calling the instance method 'create_transaction' of the interface
'if_os_transaction_manager'

3. Using the above transaction object, mark the start of OO Transaction. This is
done by calling the 'start' method of the interface 'if_os_transaction'

4. Perform the Operation (Create / Delete / Update persistent object)

5. Try to end the transaction by calling the instance method 'end' of the interface
'if_os_transaction'. If the transaction fails, cancel the transaction by calling the
method 'undo' of the interface 'if_os_transaction.

You might also like