-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Multiple DataSources & 2 open sessions
PostPosted: Fri Jun 17, 2011 1:55 pm 
Newbie

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.