Transaction handling in Oracle Service Bus

Transaction handling in Oracle Service Bus

The way transactions are handled depends on the nature of incoming request and the transaction characteristics of the partner service.

Transactional Binding

If the incoming binding for the request to OSB is transactional then the proxy will participate in that txn and any proxy/business svc invoked by this proxy will participate in the same txn.

The control of this transaction will be with the client.

If the service inturn invokes several transactional proxies/business svc’s they will be all enrolled in the intial inbound txn and committed together or rolled back together.

Non Transactional Binding

while if the incoming binding for req is non transactional eg SOAP or file transport then the txn behaviour will depend on type of proxy.

There is a difference between types of proxies available in OSB 11g than the previous versions.

Non-Transational proxy (default type and the only type that existed prior to 11g)

Unless there are incoming transactions, the proxy will not execute as part of a transaction.

Any subsequent transactional services it invokes will each execute in their own txn.

i.e. they will not necessarily be all complete or roll back together. some may succeed while others may not.

Transational proxy (A new feature in 11g)

It will initiate a new txn if one does exist in the req recieved, and there on all calls are part of the same txn, hence all commit or roll back together.

I will try to write another post soon with an example. Please provide your inputs if anyone has got any a sample on this.

7 Responses so far.

  1. Nitin says:

    @Susant : As i’ve described in the post. The OSB can initiate a transactional service using a transactional proxy and then any subsequent calls will be part of that transaction.

    In your case you pass the control to bpel and then to java which will then have to take care of the transaction.
    In order to ensure that all the invocations are part of the same transaction you have to make sure that the transaction is propagated to the services you are dependent on.

  2. susant says:

    one small clarification.
    we have scenario where we have osb calls to a bpel and bpel has webservices and intern webservice is calling to java object and it calls internally hibernate.

    so how in osb level we can handle transaction…..any idea will be appricated

  3. Nitin says:

    Hi Rajneesh,

    Thanks for your inputs, Are you refering to 11g ? My concern was mainly regarding managing transactions on Queues when you initiate them from the OSB. eg. calling a BPM process and making sure that the input request is not lost incase there is an error in the BPM process or other dependent resources. Or you can say Asynchronous calls to resources outside OSB.

    Also “reply with success” will abort the transaction but does not ensure that success of the transaction.

  4. Rajneesh says:

    Transaction is managed in OSB through Service Callouts. Request-Response criteria in service callout make sure that unless response is received from the service transaction is not complete and would be aborted in case of errors.
    We can use ‘reply with success’ in case we would like to abort the transaction. Also calling one proxy as local proxy by parent proxy maintains the transaction and is stateful. In case of proxies based on http/jms, transaction can be maintained by reliable storing the data in JMS on weblogic server.

  5. Sanjeev says:

    Hi Nitin, Sorry for the delayed response. I don’t have example but I worked in a projects where both stateless and transactions calls are made via OSB.
    In transaction calls we used JMS. so this provides guarantee delivery and reliability etc.,, and provides transaction hook-up.
    I am not sure if this is clear , if not drop me an email and will walk you through the scenario and can discuss more.

    BTW, you are covering some good stuff with regards to OSB / Oracle 11g. Good work and keep it up.

  6. Sanjeev says:

    ALSB / OSB do not provide transaction capabilities. It provides implicit transaction which means if back-end business service is participating in the transaction ALSB will simply join the same transaction as suppose to starting its own. Hope this is clear.

    • Nitin says:

      Thanks for your comments Sanjeev, I know there is nothing out of the box in OSB but I am trying to figure out the best possible work around in a scenario where your request is initiated via some osb proxy service.

      Do you have any example which shows this capability..