From a Connection object (see Client Programming Model) you can receive a Transaction object which is bound to the actual Connection object. You can then start the transaction, execute several calls and end the transaction.
Example:
………………………………………………..
// allocate and start LocalTransaction
connection.getLocalTransaction().begin();
// create Interaction and Records, fill records with business data
………………………………………………
// execute first call
MappedRecord output1 = (MappedRecord)interaction.execute(null, input1);
// evaluate output1 and using it fill the new input2 with some data.
…………………………………………….
// execute next call
MappedRecord output2 = (MappedRecord)interaction.execute(null, input2);
// make some more calls, if needed
………………………………………………
// if all this calls were proceeded successfully, then commit LocalTracaction
connection.getLocalTransaction().commit();
// after commit, all statements written with update task in ABAP will be persistet
// in the target data base
// otherwise rollback it, by calling
connection.getLocalTransaction().rollback();
// In this case all statements written with update tasks will be discarded.