Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Dieter Quickfend wrote:To add to Jaikiran's answer, you don't really require two different persistence.xml files, but you need to specify two <persistence-unit> elements in your (single) persistence.xml.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Michelle Streeter wrote:Here is the warning I am getting "Multiple persistence units defined - only the first persistence unit will be recognized"
Michelle Streeter wrote:
Also, I am getting this error when I try to publish. I am currently using only one Entity Manager.
cannot Deploy csDerbyEAR
deploy is failing=Error occurred during deployment: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [com.cs.eao.csEAO/em] in the scope of the module called [csDerbyEAR#csDerby.jar]. Please verify your application.. Please see server.log for more details.
Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method : java.lang.RuntimeException: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [com.cs.eao.csEAO/em] in the scope of the module called [csDerbyEAR#csDerby.jar]. Please verify your application.
Could not resolve a persistence unit corresponding to the persistence-context-ref-name [com.cs.eao.csEAO/em] in the scope of the module called [csDerbyEAR#csDerby.jar]. Please verify your application.
Rob Spoor wrote:Can anyone tell me if one EntityManager annotated with @PersistenceContexts and inside that two @PersistenceContext annotations would work as well?
Rob Spoor wrote:
As for the persistence version, does JPA 2.2 already exist? I haven't heard of it yet.
Michelle Streeter wrote:as for marking it resolved, it probably is for all tense and purposes. I believe the answers are correct, Now I need to figure out how to make it work. Does that make sense? Should I have waited to mark it that way until I figure it out too?
Jaikiran Pai wrote:
When you have more than 1 persistence-unit configured in your application, the server cannot determine the "default" one to use when it see a @PersistenceContext or persistence-contex-ref in your application. So you'll have to explicitly set the unitName attribute in the @PersistenceContext annotation usage (or the DD equivalent) to point it to the persistence unit to use.
Michelle Streeter wrote:So, here is my attempt at trying to come up with something that might work. It actually publishes but when I ask for people, I am getting a null pointer error. See previous message as to why I am doing hit and miss programming here.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Michelle Streeter wrote:Can you join them with each table being in a separate EM?
Michelle Streeter wrote:or just call the detail data for each iteration of the master table?
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Do you want ants? Because that's how you get ants. And a tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|