Multiple SessionFactories, Multiple DataSources and Hibernate TransactionManager can accept only one Sessionfactory

I have a @Transactional annotation in all my DAOs, but I can only define one TransactionManager that accepts only one SessionFactory. I have one SessionFactory for each client, one DataSource for each client and apparently I need to change the TransactionManager for each client. But how can I get the correct transaction manager for the client when I can only define one Spring bean name for one TransactionManager?

+5
source share
3 answers

, Spring , , . , , DAO , TransactionTemplate, .

, , JTA, Spring JtaTransactionManager. , Spring API. , DataSources SessionFactories . , DataSources , , , .

+2

PlatformTransactionManager, . , , ThreadLocal.

+1

All Articles