This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Java Persistence API: Multiple Persistence Units problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Java Persistence API: Multiple Persistence Units problem " Watch "Java Persistence API: Multiple Persistence Units problem " New topic
Author

Java Persistence API: Multiple Persistence Units problem

Aurelio Calegari
Ranch Hand

Joined: Nov 25, 2005
Posts: 54
Hi Ranchers,

I'm working with Java EE 5 and using the Java Persistence API 1.0. I have two databases, one db2 and one mysql. The connection to them are set properly and I have one table in each of these databases. I also have one Entity class for each table. The issue is that I'm getting troubles to connect both dbs in one operation. Here's my persistence.xml file:



And here's my session facade:



I'm getting the following exception:


I'm wondering if this problem is related to the fact I want both to be container managed... Any ideas on how to resolve this?

Thanks in advance

Aurelio
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
The exception you are getting means that your database connections do not support distributed transactions. Check the drivers for XA compliance, and see, for example, this discussion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Persistence API: Multiple Persistence Units problem
 
Similar Threads
no error but entity is not persisted
Help with ERROR [URLDeploymentScanner] Incomplete Deployment listing:
Jboss 6.0 Context Manager Problem
EJB3 2 client apps and 2 different databases
Error in LookUP in JBOSS 5.0.0.Beta4 EJB3.0