To use multiple transaction handlers, simply specify the qualifier and specify it. For two different DAOs with two different data sources, you will need two different transaction managers. And, of course, transactions should go through your classes of service, and not through the DAO directly. The same for any type of transactionmanager - it is hibernation or a plain old jdbc.
<bean id="transactionManagerOne" class="org.springframework.orm.hibernate4.HibernateTransactionManager" p:sessionFactory-ref="sessionFactoryOne"> <qualifier value="One" /> </bean>
and factory session
<bean id="sessionFactoryOne" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSourceOne"
and just configure the data source with the identifier dataSourceOne, then you will bind the transaction statement to the code with the name of the qualifier:
@Transactional(value = "One")
source share