How to use multiple persistence.xml in SOA

Couple of days back I was stuck into problem on how to use multiple persistance.xml in SOA (using Spring + JPA). It took me two long day to resolve the problem, hence thought it will be worth to share information. There may be better way to deal with this problem and comments\approaches are most welcome.

Scenario: We have two component SSO (Single Sign On including secirity feature) and Payment. Core component has responsiblity to provide core API, life cycle management, common utility etc. In production you can deploy SSO and Payment both component on single/different machine pointing to same DB or two database. Hence we need to have persistence.xml configured for each component.

I will explain problem is steps and we will come to solution working over different issue you can encounter (Go to Link).

Advertisements