Seems like if I create a Criteria from one session, I can not associate with another session from the same SessionFactory.
I would like to use it for a web based pageable list, and currenty I have to keep a long session and connect/disconnect it. It were much easier and better if I could open a new session at a new http request and say Criteria.setSession(newSession).
Are there any design issues with this? I could even implement it, because it may be a simple setter in the best scenario, if the session is only used to make Criteria.list() and friends possible.
|