I use Seam framework and Hibernate JPA.
I have too many databases I have to connect to from one application.
There are about 200 database schemas.
There is a databaseuser that can reach all the schemas. I thought I could use a
single EntityManagerFactory and I would use emf.createEntityManager(map); the
map would parameterize the default_schema, because there are no differences between the
construction of the different database schemas. I looked it up
in the hibernate source code but it isn't supported.
I have read the following Knowlegde Base item:
http://seamframework.org/Documentation/HowDoIUseMultipleDynamicEntityManagersInSeamI think the next fragmant slightly slow:
Code:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("manager");
EntityManager em = emf.createEntityManager();
I suppose it is too expensive to configure in component.xml all the 200 database connections to be represented.
Or should I use Hibernate SessionFactory methods?
Does anybody have any experience about this?