Discussions

EJB programming & troubleshooting: How to work with multiple persistence units

  1. Hey, I have a generic DAO. The DAO is a stateless and in the DAO the persistence context is injected: @PersistenceContext public void setEntityManager(EntityManager em) { this.em = em; } The problem that i have 5 schemas . each schema has a persistence unit , so i cant use in the default persistence unit. How you guys work in case that you have multiple schemas. Thank you
  2. I imagine you've already found a solution to this problem by now. But for anyone else searching, the answer is: How to work with multiple persistence units Posted by: avihai marchiano on May 24, 2007 @ 03:36 PM Hey, I have a generic DAO. The DAO is a stateless and in the DAO the persistence context is injected: @PersistenceContext(unitName="persistenceUnitNameHere") public void setEntityManager(EntityManager em) { this.em = em; }