When developing proxy services in OSB, transaction management can be complex.
In OSB, there are several important points to remember like:
- In proxy services, check-box “Transaction Required” : This check-box ensures OSB execute the proxy service message flow in the context of a global transaction (JTA). If a global transaction already exists, the transport provider propagates it in the request. If no global transaction exists, a new global transaction will be started. An important point to remember that, if a new transaction gets started at proxy service, the transaction will be committed at this point and not send back to the caller.
- In the proxy service, check-box “Same Transaction for Response” : by checking this option, the request thread will be propagated to the response thread so the transaction will be committed or rolled back when the response pipeline ends.
- If the transaction has to be propogated to the published service, use exactly once QoS. Refer to the OSB documentation for this option. The default “best-effort” option executes the action in the local transaction context. Only, using QoS exactly once changes the error handler behaviour so refer to the OSB documentation for the details.
- It is a good design pattern to define the transaction timeouts for global transactions.