net.sourceforge.hivetranse.transaction.hibernate3
Interface SessionsRepository

All Known Implementing Classes:
SessionsRepositoryImpl

public interface SessionsRepository

Interface implemented by the object returned by HibernateTransactionService.getCurrentTransaction. Used by SessionProxys to access a Session by its id.

Generally used internally only.

Author:
Jean-Francois Poilpret

Method Summary
 void endAllSessions(boolean close, boolean commit)
          Terminate all sessions enlisted in the current transaction.
 org.hibernate.classic.Session getSession(java.lang.String id, org.hibernate.SessionFactory factory)
          Get a Session by its id for the current transaction (in the current thread).
 

Method Detail

getSession

org.hibernate.classic.Session getSession(java.lang.String id,
                                         org.hibernate.SessionFactory factory)
Get a Session by its id for the current transaction (in the current thread). If this session does not exist yet then it is created by the underlying SessionFactory and it is "enlisted" into the current transaction.

Parameters:
id - unique identifier of the Session
factory - SessionFactory to be used to create new Session if needed
Returns:
the Hibernate session for this id and the current transaction

endAllSessions

void endAllSessions(boolean close,
                    boolean commit)
Terminate all sessions enlisted in the current transaction. Used only by HibernateTransactionService.

Parameters:
close - true if sessions should be closed immediately or not
commit - true if all sessions should be committed before closing, false if they should be rolled back