I have 2 separate modules in separate .jars which operate on 2 different databases.
The applicationContext-hibernate.xml files contain unique names for the session factories, and the web.xml loads (should load? I hope so.) both context.xml files. I also defined one of the custom sessionFactory namesin the web.xml, as you cen see here:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/applicationContext-hibernate.xml</param-value>
</context-param>
[...]
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>customsessionFactory</param-value>
</init-param>
</filter>
So the first database connection works as intended. But how do I go about to add the second one? Only one of the database beans is available from the context (of course, since the other one is not added)
I only found "How to handle multiple database connections using session factories with Spring and Hibernate" but I don't understand the answer there.