-->
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.  [ 4 posts ] 
Author Message
 Post subject: Open Session in View creating multiple sessions per JSP page
PostPosted: Sat Jun 20, 2009 7:58 am 
Newbie

Joined: Sun Mar 27, 2005 1:22 pm
Posts: 15
Hi,

I am using the Open Session in view pattern as documented in https://www.hibernate.org/43.html.

The problem is that I am getting multiple sessions opened in some JSPs, really some of my more complicated JSPs are opening about 50 sessions. Does anyone know how to trim this down so I limit my sessions per page load to 1 per page.


I cut down a JSP to try and find out what exactly causes this and found that a form would kick off 3 hibernate sessions. So..

Quote:
<div id="search">
<form >
<input name="Submit" type="image" src="/images/icons/search-button.jpg" class="search-button" value="Go" />
<img src="/images/icons/google-search.jpg" alt="google" />
</form>
</div>


..creates three where as this only causes one..

Quote:

<div id="search">
<form >

</form>
</div>




Thanks


Top
 Profile  
 
 Post subject: Re: Open Session in View creating multiple sessions per JSP page
PostPosted: Sat Jun 20, 2009 8:11 am 
Newbie

Joined: Sun Mar 27, 2005 1:22 pm
Posts: 15
Think I got it

HibernateSessionConversationFilter

I should read the docs more.


Top
 Profile  
 
 Post subject: Re: Open Session in View creating multiple sessions per JSP page
PostPosted: Sat Jun 20, 2009 8:40 am 
Newbie

Joined: Sun Mar 27, 2005 1:22 pm
Posts: 15
That actually did not work.

So the question of how do I limit a hibernate session to a http request remains.

Thanks


Top
 Profile  
 
 Post subject: Re: Open Session in View creating multiple sessions per JSP page
PostPosted: Sat Jun 20, 2009 9:00 am 
Newbie

Joined: Sun Mar 27, 2005 1:22 pm
Posts: 15
It is actually making new 3 new http requests for the page load which is confusing, so this may be a web server issue but I would think that someone may have had this problem before with hibernate of they use the session in view pattern.

I am using tomcat 6.0.20.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.