Results 1 to 2 of 2

Thread: AbstractTransactionalDataSourceSpringContextTests and multiple SessionFactories

  1. #1
    Join Date
    Apr 2005
    Posts
    8

    Default 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

  2. #2
    Join Date
    Apr 2005
    Posts
    8

    Smile 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
  •