-
Jun 6th, 2006, 09:04 AM
#1
AbstractTransactionalDataSourceSpringContextTests and multiple SessionFactories
Hi all
I'm using the spring class AbstractTransactionalDataSourceSpringContextTests, but since I have defined two SessionFactories and two DataSources (I have to connect to two different Databases), the spring container can't auto-wiring the beans by type.
"No problem", I thought: just wire them manually. But I can't set a DataSource on the SessionFactory. And when I cast the SessionFactory to a LocalSessionFactoryBean, my DAO class doesn't accept it because it's based on the spring class HibernateDaoSupport which needs a SessionFactory.
How can I wire these classes?
Thanks for your help
Stefan
-
Jun 6th, 2006, 09:22 AM
#2
pragmatic solution
ok, I just found a pragmatic solution for my problem: I use two different contextfiles - one for each database-connection. therefore I can load the needed file in each of the two tests.
Well, better solutions are still welcome!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules