|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.toplink.AbstractSessionFactory org.springframework.orm.toplink.SessionBrokerSessionFactory
public class SessionBrokerSessionFactory
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.
ServerSessionFactory
,
ServerSession.acquireClientSession()
,
SessionBroker.acquireClientSessionBroker()
Field Summary |
---|
Fields inherited from class org.springframework.orm.toplink.AbstractSessionFactory |
---|
logger |
Constructor Summary | |
---|---|
SessionBrokerSessionFactory(oracle.toplink.sessionbroker.SessionBroker broker)
Create a new SessionBrokerSessionFactory for the given SessionBroker. |
Method Summary | |
---|---|
void |
close()
Shut the pre-configured TopLink SessionBroker down. |
protected oracle.toplink.sessions.Session |
createClientSession()
Create a plain client SessionBroker for this factory's ServerSession. |
oracle.toplink.sessions.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 oracle.toplink.sessions.Session |
getMasterSession()
Return this factory's SessionBroker as-is. |
Methods inherited from class org.springframework.orm.toplink.AbstractSessionFactory |
---|
createManagedClientSession, createTransactionAwareSession, createTransactionAwareSession |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionBrokerSessionFactory(oracle.toplink.sessionbroker.SessionBroker broker)
broker
- the TopLink SessionBroker to fetch Sessions fromMethod Detail |
---|
public oracle.toplink.sessions.Session createSession() throws oracle.toplink.exceptions.TopLinkException
createSession
in interface SessionFactory
createSession
in class AbstractSessionFactory
oracle.toplink.exceptions.TopLinkException
- in case of errorscreateClientSession()
,
getMasterSession()
protected oracle.toplink.sessions.Session getMasterSession()
getMasterSession
in class AbstractSessionFactory
protected oracle.toplink.sessions.Session createClientSession() throws oracle.toplink.exceptions.TopLinkException
createClientSession
in class AbstractSessionFactory
oracle.toplink.exceptions.TopLinkException
- if creation of a client Session failedSessionBroker.acquireClientSessionBroker()
public void close()
DatabaseSession.logout()
,
Session.release()
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |