This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have two persistence units in one persistence.xml
Each persistence unit connected with separate database and using Hibernate.
say Entitymanager em1 for persistence unit1 and
Entitymanager em2 for persistence unit2.
I get an entity from em1 using JPQL and it has values.
I want to persist this entity with em2.
I am getting an error "detached entity passed to persist."