com.infodesire.infobit.hibernate
Class ThreadLocalSessionProvider

java.lang.Object
  |
  +--com.infodesire.infobit.hibernate.BaseSessionProvider
        |
        +--com.infodesire.infobit.hibernate.ThreadLocalSessionProvider
All Implemented Interfaces:
SessionProvider

public class ThreadLocalSessionProvider
extends BaseSessionProvider

thread local session provider.

Version:
$Revision: 1.4 $
Author:
konstantin

Constructor Summary
ThreadLocalSessionProvider()
           
 
Method Summary
 net.sf.hibernate.Session getSession()
          Gets the Session attribute of the DefaultSessionProvider object
 void returnCloseSession(net.sf.hibernate.Session sess)
          give session back and close it
 void returnSession(net.sf.hibernate.Session sess)
          give session back.
 void rollback()
          rollback current transaction.
 
Methods inherited from class com.infodesire.infobit.hibernate.BaseSessionProvider
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLocalSessionProvider

public ThreadLocalSessionProvider()
Method Detail

getSession

public net.sf.hibernate.Session getSession()
                                    throws net.sf.hibernate.HibernateException
Gets the Session attribute of the DefaultSessionProvider object

Returns:
The Session value
Throws:
net.sf.hibernate.HibernateException - Description of Exception

rollback

public void rollback()
              throws net.sf.hibernate.HibernateException
rollback current transaction. shall be called in cse of any hibernate exception

Throws:
net.sf.hibernate.HibernateException - Description of Exception

returnSession

public void returnSession(net.sf.hibernate.Session sess)
give session back. without closing. no op here.

Parameters:
sess - session to be returned

returnCloseSession

public void returnCloseSession(net.sf.hibernate.Session sess)
                        throws net.sf.hibernate.HibernateException
give session back and close it

Parameters:
sess - session to be closed
Throws:
net.sf.hibernate.HibernateException - may be thrown by hibernate


Copyright © 2003 Information Desire GmbH. All Rights Reserved.