2

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

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

1 Answers1

1

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.

Trixx
  • 1,796
  • 1
  • 15
  • 18
  • Thank you. I will go ahead with explicit call – Suhail Zamir Jul 18 '19 at 07:15
  • +1 for using `BAPI_TRANSACTION_ROLLBACK` which does also some internal stuff like memory cleanup which may be required between 2 BAPI calls in the same LUW (which otherwise might lead to an error of next BAPI calls) --as does `BAPI_TRANSACTION_COMMIT`-- – Sandra Rossi Apr 17 '23 at 13:58