on 01-18-2011 8:10 AM
Hello,
I'm using JPA implementation for my EJB Project.
I have 2 persistence units and I'm using them in the same method.
I want to persist 2 object belonging each one to a different persistence unit
The 2 persistence units are related to different databases.
Everything is going fine and no exception is raised BUT only one object is persisted and the other one is not.
Have anyone had a similar problem before.
Any help will be appreciated.
Thanks in advance.
Edited by: ImaneA on Jan 18, 2011 9:29 AM
Hi,
are the data sources set up in NWA as XADataSources ?
Regards
Rolf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the SAP official documentation the following is stated:
Due to the specifics of the Dali JPA Tools project, we recommend that you define only one persistence unit within the persistence.xml file.
(http://help.sap.com/saphelp_nwce72/helpdata/en/48/f8238a550240aae10000000a421937/frameset.htm)
...which at first would mean that you should use two persistence.xml files (i.e. two separate projects (EJB, JPA, Web...)) for your two persistence units.
Regards,
Yordan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Yordan :
First of all, thanks a lot for you answer.
At the end, I didn't use two EJB Projects :
1 - I used only one datasource( associated to one database ) in the persistence.xml
2 - I created a DBLink in SQL Server
3 - I created a synonym in the first database to get data from the second database.
And it works
But thanks for the answer, I may use you solution in my next project
@Rolf :
No, In NWA I've declared my datasources as normal datasources.
But Plz if you have docs that talks about XDataSources plz share them and thanks in advance.
Edited by: ImaneA on Jan 25, 2011 9:21 AM
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.