Here is the background: I have a need to connect to a number of DBs, and after reading the post on How to connect to multiple databases in Hibernate, I decided to give it a try, and wrote 3 "HibernateListener", each containing one SessionFactory, each corresponding to a hibernate-*.cfg.xml. However, it seems that only one of these "HibernateListeners" remains active after their initialisation. I suspect that the problem comes from declaring 3 listeners in web.xml, one for each "HibernateService":
<listener>
<listener-class>org.mypackage.HibernateListener1</listener-class>
</listener>
<listener>
<listener-class>org.mypackage.HibernateListener2</listener-class>
</listener>
<listener>
<listener-class>org.mypackage.HibernateListener3</listener-class>
</listener>
Is this even allowed or do I have to cram my SessionFactories into one listener ?
Infos: Tomcat 7, Hibernate 3.5.6 (using annotations) Probably unneeded: mysql-connector java 5.1.23, MySQL 5.1.69. Also: no Spring