Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-04-2009, 08:08 AM
Member
 
Join Date: Nov 2009
Posts: 2
Rep Power: 0
dalchndr@gmail.com is on a distinguished road
Default ThreadLocal Session instance in Hibernat
In mu web application after some time nearly 5-6 H. threadLocal Session instance return is null value.
Why this is happened i not under stand.

we used configuration.

<property name="connection.pool_size">50</property>
<!-- Enable hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

we use this function for getSession.but this return Null value after 5 to 6 H web site running.

public static Session getSession() throws HibernateException {
Session session = (Session) threadLocal.get();

if (session == null || !session.isOpen()) {
if (sessionFactory == null) {
rebuildSessionFactory();
}
session = (sessionFactory != null) ? sessionFactory.openSession()
: null;
threadLocal.set(session);
}

return session;
}

Any one help me for resolving this Problem.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Kill session at application context level by using session Id Kishore.Kumar Java Servlet 1 04-22-2009 12:20 AM
How do I create session for a user when S/he login and expire the session. dpk_vash Web Frameworks 2 12-23-2008 07:35 PM
ThreadLocal - II JavaForums Java Blogs 0 08-20-2008 01:20 PM
ThreadLocal - I JavaForums Java Blogs 0 08-20-2008 01:20 PM
When to use ThreadLocal Ashish Threads and Synchronization 3 04-23-2008 07:50 PM


All times are GMT +2. The time now is 02:20 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org