It's not a secret anymore!*
The moose likes Object Relational Mapping and the fly likes Hibernate/JPA Dealing with entities with the same name in different persistence units 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 "Hibernate/JPA Dealing with entities with the same name in different persistence units" Watch "Hibernate/JPA Dealing with entities with the same name in different persistence units" New topic
Author

Hibernate/JPA Dealing with entities with the same name in different persistence units

John Ament
Greenhorn

Joined: Jul 07, 2007
Posts: 22
When I looked at how they setup the databases, I didn't think it would be an issue, but apparently it is.

Basically, we have schemas in multiple database that match almost exactly. For the sake of what I'm doing, all affected entities are the same in all 8 schemas. My application runs on jboss 5.1 and uses the latest hibernate on there (I assume a 3.2 release). All of the databases are oracle. When I run a query for one of these objects, I get no results, even though there are results. I refactored my code to use a PK find in the EM, and the result was the below stack trace:



The way my code works is that for each of these 8 schemas, there's a different persistence unit. My understanding was that the mapping was local to the persistence unit (similar to the hibernate mappings and each individual session factory). Was I wrong on this one?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hibernate/JPA Dealing with entities with the same name in different persistence units
 
Similar Threads
The Perennial Lazy loading dilemma from the heart of a novice
Axis Error java.lang.NoClassDefFoundError: org/apache/commons/discovery/tools/DiscoverSingleton
javax.naming.NotContextException
conflict Jboss+WebLogic web service
Error while calling webservice client from EJB3 SLB Local interface.