| |
|
| java.lang.Object org.springframework.orm.toplink.AbstractSessionFactory org.springframework.orm.toplink.SessionBrokerSessionFactory
SessionBrokerSessionFactory | public class SessionBrokerSessionFactory extends AbstractSessionFactory (Code) | | Spring SessionFactory implementation allowing users to
inject a TopLink Session built from a TopLink SessionBroker.
SessionBrokers are used identically to any other TopLink Session. DAO code
should never have to distinguish between Sessions which broker requests to
multiple databases and Sessions which manage requests to a single database.
The only pertinent difference in the SessionBroker api involves the method
for obtaining a thread-safe "client" Session from the SessionBroker.
Instead of the typical acquireClientSession
method, this SessionFactory implementation uses the
acquireClientSessionBroker method.
If a SessionBroker aggregates non thread-safe DatabaseSessions,
the factory will throw UnsupportedOperationExceptions
if used to create managed or transaction-aware Sessions.
author: James Clark author: Juergen Hoeller since: 1.2.6 See Also: org.springframework.orm.toplink.ServerSessionFactory See Also: oracle.toplink.threetier.ServerSession.acquireClientSession See Also: oracle.toplink.sessionbroker.SessionBroker.acquireClientSessionBroker |
Constructor Summary | |
public | SessionBrokerSessionFactory(SessionBroker broker) Create a new SessionBrokerSessionFactory for the given SessionBroker. |
Method Summary | |
public void | close() Shut the pre-configured TopLink SessionBroker down. | protected Session | createClientSession() Create a plain client SessionBroker for this factory's ServerSession. | public Session | createSession() Try to create a client Session; fall back to the master Session,
if no client Session can be created (because of the session broker's
configuration). | protected Session | getMasterSession() Return this factory's SessionBroker as-is. |
SessionBrokerSessionFactory | public SessionBrokerSessionFactory(SessionBroker broker)(Code) | | Create a new SessionBrokerSessionFactory for the given SessionBroker.
Parameters: broker - the TopLink SessionBroker to fetch Sessions from |
close | public void close()(Code) | | Shut the pre-configured TopLink SessionBroker down.
See Also: oracle.toplink.sessions.DatabaseSession.logout See Also: oracle.toplink.sessions.Session.release |
createClientSession | protected Session createClientSession() throws TopLinkException(Code) | | Create a plain client SessionBroker for this factory's ServerSession.
See Also: oracle.toplink.sessionbroker.SessionBroker.acquireClientSessionBroker |
getMasterSession | protected Session getMasterSession()(Code) | | Return this factory's SessionBroker as-is.
|
Fields inherited from org.springframework.orm.toplink.AbstractSessionFactory | final protected Log logger(Code)(Java Doc)
|
Methods inherited from org.springframework.orm.toplink.AbstractSessionFactory | abstract protected Session createClientSession() throws TopLinkException(Code)(Java Doc) public Session createManagedClientSession() throws TopLinkException(Code)(Java Doc) public Session createSession() throws TopLinkException(Code)(Java Doc) public Session createTransactionAwareSession() throws TopLinkException(Code)(Java Doc) public Session createTransactionAwareSession(SessionFactory sessionFactory) throws TopLinkException(Code)(Java Doc) abstract protected Session getMasterSession()(Code)(Java Doc)
|
|
|
|