Two Dabase connection using spring with Hibernate
I want to connect two database in my application as of now we are saving and retrieving data in single database only, now we have the requirement like some data we need pick up from one database and some data from another database. So how could I connect to different database using my application with spring and hibernate, and it has to support the transaction management for two database .
Thanks in advance for your valuable information.
Thanks for your quick reply ,
As we suggested we can create the two datasources objects then we can create the two sessionFactoryObjects but how can we create the transaction Manager for two sessionFactoryObjects ?
I have done as you suggested in earlier but I failed while applying transaction manager .
Below of my code for the transaction.
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<ref local="sessionFactory1" />
<ref local="sessionFactory2" />
pls suggest on the same.