If you inject multiple EntityManagers into the same class with different persistence
units, I assume that would allow for persisting objects to different databases within the
same class.
What I'm wondering about is the ability to inject multiple EntityManagers or
EntityManagerFactory with the SAME persistence unit in the same class. What purpose might
something like this hypothetically serve?
I saw an example where one class had one injected EntityManager of a given persistence
unit, and a created EntityManager (from EntityManagerFactory.createEntityManager() where
the EntityManagerFactory has the same persistence unit).
What purpose would either of these scenarios have...multiple EntityManagers (either
injected directly or through the EntityManagerFactory) with the SAME persistence unit in
one class?
I'm confused on this issue because I can't see what the purpose of the same
persistence unit would be...couldn't even guess...
Thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976725#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...