org.apache.tapestry5.internal.hibernate
Class HibernateSessionManagerImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl
All Implemented Interfaces:
EventListener, HibernateSessionManager, ThreadCleanupListener

public class HibernateSessionManagerImpl
extends Object
implements HibernateSessionManager, ThreadCleanupListener


Constructor Summary
HibernateSessionManagerImpl(HibernateSessionSource source)
           
 
Method Summary
 void abort()
          Aborts the current transaction, and starts a new transaction to replace it.
 void commit()
          Commits the current transaction (which will cause a flush of data to the database), then starts a new transaction to replace it.
 org.hibernate.Session getSession()
          Gets the active session for this request, creating it as necessary.
 void threadDidCleanup()
          Rollsback the transaction at the end of the request, then closes the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateSessionManagerImpl

public HibernateSessionManagerImpl(HibernateSessionSource source)
Method Detail

abort

public void abort()
Description copied from interface: HibernateSessionManager
Aborts the current transaction, and starts a new transaction to replace it.

Specified by:
abort in interface HibernateSessionManager

commit

public void commit()
Description copied from interface: HibernateSessionManager
Commits the current transaction (which will cause a flush of data to the database), then starts a new transaction to replace it.

Specified by:
commit in interface HibernateSessionManager

getSession

public org.hibernate.Session getSession()
Description copied from interface: HibernateSessionManager
Gets the active session for this request, creating it as necessary. When the session is first created, a transaction is started.

Specified by:
getSession in interface HibernateSessionManager
Returns:
the request's session
See Also:
HibernateSessionSource

threadDidCleanup

public void threadDidCleanup()
Rollsback the transaction at the end of the request, then closes the session. This means that any uncommitted changes are lost; code should inject the HSM and invoke commit() after making any changes, if they should persist.

Specified by:
threadDidCleanup in interface ThreadCleanupListener


Copyright © 2003-2012 The Apache Software Foundation.