Tuesday, 13 November 2012

DB Adapter Singleton behaviour in High Availability Environment

There was a problem which one can face in high availability environment (clustered) . 

We had one Integration between Oracle Ebiz and third party system in which we get data from Oracle Ebiz and send them to third party application. This integration was running fine till the time our server environment upgraded for high availability means clustered ones...
We had two clustered which were configured to be synchronous to idealised HA situation. But this causes one design issue in that Integration. 

The issue starts coming in our DB Adapter that now the DB Adapter starting polling Staging table(OEBS)  in parallel with the initialised interval. Cluster1 and Cluster2 starts initiating DB Adapter instances in parallel and if we increase the clusters form 2 to 3. The same way three instances of pooling components started. Which leads to a situation in which if we increase the clusters in future from 2 to 50 then in parallel 50 instances of pooling component will be created in parallel and will hit the third party application in parallel. This could be a problem for a target system if it doesn't supports parallel processing.

The solution to this problem was that we need a concept of singleton pattern in our pooling component / DB Adapter.

There's a property of Inbound endpoint lifecycle support within Adapters called Singleton.
To enable this feature for high availability environment for a given inbound adapter endpoint, one must add the singleton JCA service binding property in the composite.xml within the <binding.jca> element and set it to a value of true as shows.


Singleton Property in composite.xml

    <binding.jca config="bindin_file.jca">
        <property name="singleton">true</property>
    </binding.jca> 
 
This was our finding to the problem we faced in clustered environment.

I hope this helps others as well.

 
 

29 comments:

  1. How about in OSB ? We will not use the config file ryt ?

    ReplyDelete
    Replies
    1. Hi Raj,

      This can be achieved on Oracle Service Bus by editing the Configuration Details of the proxy service and set 'Topic Message Distribution' to 'One Copy Per Application'.

      I hope this helps....

      Delete
    2. "Topic Message Distribution" comes up only for JMS reads...what if we are using JCA DB adapter to poll files? The DB adapter is created in JDev and imported in OSB. Is there anything that can be done here?

      Delete
    3. Hi Mustafa,

      DB Adapter can't read the file. It is use to talk to datbase. FTP Adapters are used to poll files. When we create DB Adapter in Jdev and import them into the eclipse ( for OSB implementation ) we can add the same JCA properties.

      You're right 'Topic Message Distribution' setting in proxy is for JMS Adapters.

      Regards,
      Aysha

      Delete
    4. Thanks, my explanation of usage was a little terse, we are using JCA DB adapter for a sequential polling with file as helper. Anyway, that's not the real problem, the 'singleton' property is actually a SOA Composite property, how can we put this in the JCA imported in OSB?

      Delete
  2. Thanks for the Post. It was really helpful :)

    ReplyDelete
  3. Thanks Aysha, I will give this a go.. If I am not wrong this is something that can be done from the em console and does not require a redeployment.

    ReplyDelete
  4. Hi Nitin,

    I think this needs to be done into the code not from the em console. But if you find anything like this you can share your experience.

    Regards,
    Aysha

    ReplyDelete
  5. Hi Aysha,

    Ideally you would want to do this from the source in the composite.xml as you said however on an already deployed composite you can go the properties of the db adapter from the EM console and add a new property

    you will see 'singleton' in that list and we can set it to 'true'
    http://nitinaggarwal.wordpress.com

    ReplyDelete
  6. The above change would mean that you get the following entry into your composite.xml on the runtime.

    true

    ReplyDelete
  7. Yes you're right Nitin this can be updated in JCA settings from Em Console.

    But as you have already mentioned fresh deployment of the same component can overwrite this change.

    Regards,
    Aysha

    ReplyDelete
  8. Singelton property is added in the composite.xml in Bpel.
    Does anyone have idea, where exactly in OSB, this singleton property will be added for the proxy services which is polling Database.

    ReplyDelete
  9. @stalin richard you can check the distributed polling during DB adapter configuration for Polling.

    ReplyDelete
  10. I have another problem-my DBadapter is used in OSB business service and is doing merge and when the table is empty and creating two entries.How to make it singleton?

    ReplyDelete
  11. Hi Soumajita,

    Can you explain a bit more. I did not get the scenario clearly.

    Regards,
    Aysha

    ReplyDelete
  12. Sorry for replying late..some how I don't get any notification in my mailbox.!! Ayesha in my case the DB Adapter is used with OSB with merge and deployed in clustered environment.When the table was empty OSB- BS was creating two entries rather than only one insert. I do not find any alternatives..rather than manually inserting one dummy row. Then it is able to merge-update that row. Just wanted two know in case of insert/merge how to include the singleton property in OSB.? Any thoughts?

    ReplyDelete
  13. Use Procedure as workaround (or) follow this article - good idea - http://www.avioconsulting.com/blog/oracle-soa-database-adapter-polling-cluster-handy-logical-delete-pattern

    ReplyDelete
  14. In cluster environment with 2 managed servers then how it knows that one server should to work for poll the messages , in case server1 went down that time server 2 will poll the messages or it will wait for the server1 running state.

    ReplyDelete
  15. Hi.....
    The given content is useful for our company. We IT Hub Online Training providing Oracle SOA Online Training. For any more information visit our site...

    ReplyDelete
  16. Thanks for the nice topic. Very useful information.
    We IT hub Online Training are good in giving the oracle apps technical Training

    ReplyDelete
  17. This is really very happy for the great info is visible in this blog and thanks a lot for using the nice info is visible in this blog.Oracle Apps Technical Online Training

    ReplyDelete
  18. While configuring a DB adapter in a clustered environment we anyways select the "Distributed Polling" option.Then what's the real use Singleton property.Could you please assist by making it clear :-)

    ReplyDelete
    Replies
    1. Singleton is used to avoid a situation when adapter\bpel deployed on different nodes tries to read same records and duplication is not affordable in a business case.

      Delete
  19. Thank you for sharing this kind of useful information,
    It is very useful to me and like who are searching for Oracle SOA online training from USA, UK and India.

    ReplyDelete
  20. Thank you for posting this blog. Your blog is so interesting. If you are looking for best Oracle fusion financials Online coaching, Our on-line coaching supplier gained the high commonplace name through worldwide for its teaching.
    Oracle fusion financials training

    ReplyDelete
  21. Hi,
    You have performed a great job by posting article oracle SOA. I will definitely digg it and for my part recommend to my friends. I'm sure they will be benefited from this site.
    Thank you,
    Oracle Financials training

    ReplyDelete
  22. This article creates a new hope and inspiration with in me. Thanks for sharing article like this.
    The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.



    Oracle fusion Financials Training in hyderabad

    Oracle Fusion Financials online Training in hyderabad

    ReplyDelete
  23. BlueHost is ultimately the best hosting company with plans for all of your hosting requirements.

    ReplyDelete