Transaction context is not available by default between OSB and composite calls unless special care is taken.
OSB transaction scope/boundary depends upon below
In this post, let's explore what is required to achieve this.We will take particular scenario and explain the steps
Scenario is OSB proxy consumes messages from JMS queue and invokes BPEL. In case of any failure either in OSB or in BPE,L transaction should be rolled back and message should be available in JMS queue
To make above scenario statement true, we might need to develop services according to below principles
OSB design
Composite design
OSB transaction scope/boundary depends upon below
- Transport provider
- QOS
In this post, let's explore what is required to achieve this.We will take particular scenario and explain the steps
Scenario is OSB proxy consumes messages from JMS queue and invokes BPEL. In case of any failure either in OSB or in BPE,L transaction should be rolled back and message should be available in JMS queue
To make above scenario statement true, we might need to develop services according to below principles
OSB design
- Use JMS XA connection factory on proxy service
- Please enable transactions on OSB proxy message handling to make sure messages are rolled back to JMS queue.This setting essentially makes proxy as sync service despite of original pattern
- If OSB proxies has error handler stages then use RaiseError action from error stage.
- Make sure all publish/service call out actions in proxy flow has ‘exactly-once’ QOS otherwise they will be executed outside of transaction context
- Do not use "Reply with success or failure" from error handlers. This action will commit the transaction
- Create OSB business service with SOA-DIRECT transport which calls composite.Only SOA-DIRECT transport supports transactions
Composite design
- Create composite with direct binding service exposure.Composite direct binding is compliant to SOA-DIRECT and invokes composite end point via RMI using t3/t3s protocol
- If BPEL has catch/catch all, then throw Rollback exception to caller.If BPEL doesn’t has catch/catch all then system level fault handler will roll back the transaction to the caller
- If composite has fault-polices then transaction might not be rolled back to OSB in case of BPEL faults, so do not use fault-policies when planning for transaction propagation.Fault policies executes in its own thread and transaction, suspending existing transaction
- Set component property name="bpel.config.transaction" to “required”
- If we want to perform some tasks (DB,JMS) in BPEL outside of transaction scope then use NonXA connections
This comment has been removed by the author.
ReplyDeleteHi,I have a service which is atomic transaction, So when we are invoking atomic transactional service over proxy service, we are getting the error "Transaction context is required", As for same we added policy file of AT in business and proxy service but again we are getting same error.
ReplyDeleteplease help me
I wish to show thanks to you just for bailing me out of this particular trouble. As a result of checking through the net and meeting techniques that were not productive, Same as your blog I found another one Oracle OSB 12c.Actually I was looking for the same information on internet for Oracle OSB 12c and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.
ReplyDelete