Search code examples
bapijco

When using SAP JCO 3.0 is it necessary to invoke BAPI_TRANSACTION_ROLLBACK?


Is it necessary to invoke BAPI_TRANSACTION_ROLLBACK or just JCoContext.end(<JcoDestination>) will do an implicit rollback?


Solution

  • If the particular JCoContext.end() will end the stateful call sequence (which is not true for a nested context) then the respective underlying RFC connection will be reset. And this means that also an associated uncommitted LUW (Logical Unit of Work) will be canceled which results in an implicit rollback.

    But if you know that a rollback is required then why not calling BAPI_TRANSACTION_ROLLBACK directly? I would prefer explicit operations instead of implicit assumptions. I guess this would make debugging and tracing easier as well.