-->
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.  [ 2 posts ] 
Author Message
 Post subject: Multiple OpenSessions in view
PostPosted: Fri Mar 16, 2007 9:55 am 
Newbie

Joined: Wed Jan 17, 2007 10:32 am
Posts: 6
I have two databases that I read from. The software that I am working on is designed to connect to the primary, we'll call internal, database when the web application starts. The user logs and and connects to a secondary, we'll call external, database at some point in the application.

I have an OpenSessionInViewFilter setup which takes care of the internal database, as I load up applicationContext-internal via web.xml when the application loads. However, the way that I am doing it now, on the pages that deal with the external database, I am manually getting applicationContext-external in each controller that needs it, and opening a session for that controller, and I am explicitly calling collections to hydrate them, before returning the view.

So, my question is, is there a way to add a session to the current OpenSessionInView.

Does anyone see another way for me to do what I need to do here?

Can I add and remove the applicationContext-external to the applicationContext at runtime and have those classes that are mapped to the external database loaded when necessary?

Thanks.
~ Mike


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 16, 2007 1:22 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
I think the best way to go for you is implement your own opensessioninviewfilter based on the existing one to deal with both sessions. This won't be too complex to do

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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

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.