This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

John Ament
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic