Joined: Fri Jun 17, 2011 1:47 pm Posts: 1
|
I am using Spring & Hibernate and attempting to change our application to utilize 2 datasources (1 for readonly access, 1 for readwrite)
I set up the 2 data sources and 2 session factories ( & mapped the session factories to the appropriate daos)
I'm now getting a Hibernate Exception "Illegal attempt to associate a collection with two open sessions"
I'm not sure if this is the correct way to do this (most posts I read are from 2007).
Can you tell me 1. Should have 2 session factories? 2. How should I prevent 2 open sessions? Should I be closing\opening the sessions each time I use them in the DAOs?
Thanks! Beth
|
|