org.springframework.orm.toplink
Class ServerSessionFactory

java.lang.Object
  extended by org.springframework.orm.toplink.AbstractSessionFactory
      extended by org.springframework.orm.toplink.ServerSessionFactory
All Implemented Interfaces:
SessionFactory

public class ServerSessionFactory
extends AbstractSessionFactory

Full-fledged default implementation of the SessionFactory interface: creates ClientSessions for a given ServerSession.

Can create a special ClientSession subclass for managed Sessions, carrying an active UnitOfWork that expects to be committed at transaction completion (just like a plain TopLink Session does within a JTA transaction).

Can also create a transaction-aware Session reference that returns the active transactional Session on getActiveSession.

Since:
1.2
Author:
Juergen Hoeller
See Also:
SingleSessionFactory, Session.getActiveUnitOfWork(), Session.getActiveSession()

Field Summary
 
Fields inherited from class org.springframework.orm.toplink.AbstractSessionFactory
logger
 
Constructor Summary
ServerSessionFactory(oracle.toplink.threetier.ServerSession serverSession)
          Create a new ServerSessionFactory for the given ServerSession.
 
Method Summary
 void close()
          Shut the pre-configured TopLink ServerSession down.
protected  oracle.toplink.sessions.Session createClientSession()
          Create a plain ClientSession for this factory's ServerSession.
protected  oracle.toplink.sessions.Session getMasterSession()
          Return this factory's ServerSession as-is.
 
Methods inherited from class org.springframework.orm.toplink.AbstractSessionFactory
createManagedClientSession, createSession, createTransactionAwareSession, createTransactionAwareSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSessionFactory

public ServerSessionFactory(oracle.toplink.threetier.ServerSession serverSession)
Create a new ServerSessionFactory for the given ServerSession.

Parameters:
serverSession - the TopLink ServerSession to create ClientSessions for
Method Detail

getMasterSession

protected oracle.toplink.sessions.Session getMasterSession()
Return this factory's ServerSession as-is.

Specified by:
getMasterSession in class AbstractSessionFactory

createClientSession

protected oracle.toplink.sessions.Session createClientSession()
                                                       throws oracle.toplink.exceptions.TopLinkException
Create a plain ClientSession for this factory's ServerSession.

Specified by:
createClientSession in class AbstractSessionFactory
Throws:
oracle.toplink.exceptions.TopLinkException - if creation of a client Session failed
See Also:
ServerSession.acquireClientSession()

close

public void close()
Shut the pre-configured TopLink ServerSession down.

See Also:
DatabaseSession.logout(), Session.release()


Copyright (c) 2002-2006 The Spring Framework Project.