Hi guys,
I need to develop an EJB that will work with 4 databases. I am looking in google for the best solution to work with 4 persistence units but I don't have a clear idea about the best solution and the most efficient one.
I dont' know if I inject using @PersistenceUnit() and EntityManagerFactory (one for each of the persistence units) and then create entityManagers using an EntityManagerFactory to choose the EntityManager for the selected persistence unit.
¿If I use 4 @persistentunit injects, will I consume 4 connections to the database ?
Please help.
Thanks !
Chris
I need to develop an EJB that will work with 4 databases. I am looking in google for the best solution to work with 4 persistence units but I don't have a clear idea about the best solution and the most efficient one.
I dont' know if I inject using @PersistenceUnit() and EntityManagerFactory (one for each of the persistence units) and then create entityManagers using an EntityManagerFactory to choose the EntityManager for the selected persistence unit.
¿If I use 4 @persistentunit injects, will I consume 4 connections to the database ?
Please help.
Thanks !
Chris