-
Oct 14th, 2004, 09:32 AM
#1
Multiple datasources and thus multiple sessionFactories
We are using 2 datasources and therefore defined 2 different sessionFactories in the application context files.
Problem is that OpenSessionInViewFilter can only fetch 1 sessionFactory.
How can we solve this within the logic of the framework ?
Subclass OpenSessionInViewFilter so that it can fetch a list of sessionFactories.
Edwin
-
Oct 14th, 2004, 07:52 PM
#2
You could configure two filters. When OpenSessionInViewFilter fires, it creates a new Hibernate session (if none can be found) and registers it within TransactionSynchronizationManager using sessionFactory as the key. Since you are using two sessionFactories, you can use two Hibernate Session at the same time.
HTH
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