-
Create UserTransaction :
UserTransaction userTransaction = (UserTransaction) initialcontext.lookup("java:comp/UserTransaction");
or get UserTransaction from Servlets Context (valid only for Servlets).
UserTransaction userTransaction = m_sessionContext.getUserTransaction();
-
Start userTransaction :
userTransaction.begin();
-
Create Interaction and Records , then fill records with business data.
execute first call MappedRecord output1 = (MappedRecord)interaction.execute(null, input1);
-
Evaluate output1 and use it to fill the new input2 with some data.
-
Execute a second call:
MappedRecord output2 = (MappedRecord)interaction.execute(null, input2);
-
Execute more calls, if needed.
-
If all these calls were processed successfully, then commit LocalTransaction :
userTransaction.commit();
After COMMIT , all statements written with UPDATE TASK in ABAP will be persisted in the data base.
-
Otherwise execute a ROLLBACK :
userTransaction.rollback();
In this case all statements written with UPDATE TASK will be discarded.