|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.common.ampool.SessionCookieImpl | +--oracle.jbo.http.HttpSessionCookieImpl | +--oracle.jbo.http.SharedSessionCookieImpl
A shared application module handle.
Some enterprise applications may define static data that is required across sessions and does not change very frequently. An example of this type of data might be application metadata that is used to render the application UI. If BC4J is used to access the static data then an unnecessary overhead is incurred if the static data caches are repopulated from the database for each application session on every request. In order to optimize performance common practice is to cache the shared static data for reuse across sessions and requests.
This class supports shared, static data caches by allowing requests from multiple sessions to share a single application module instance which is managed by an application pool for the lifetime of the web server VM.
The SharedSessionCookieImpl extends the HttpSessionCookieImpl with the following logic for managing access to a shared application module instance:
The SharedSessionCookieFactory
may be used to instantiate SharedSessionCookieImpl sessions for an application pool. The application developer may use the SharedSessionCookieImpl with an application pool by specifying the following BC4J property in the configuration of the application module that will be used to cache static data:
jbo.ampool.sessioncookiefactoryclass=oracle.jbo.http.SharedSessionCookieFactory
After having declared the property above the application developer may access the shared application module instance with any application pooling client like the BC4J data tags and the BC4J data web beans.
Finally, the application developer should be careful about mutating the shared transactional state after a shared session cookie has been used. Most shared state should be "built and cached" only once after an application module is created or connected and before it has become available for use. One recommended place to initialize shared ApplicationModule state is the prepareSession method which is invoked after an ApplicationModule has been connected and is also threadsafe.
A session may use the locking mode when acquiring an ApplicationModule to synchronize access to the shared ApplicationModule instance. However, if locking is used extra care should be taken to ensure that the locking request releases the lock by including the useApplicationModule and releaseApplicationModule invocations in a try...finally block.
Please see HttpSessionCookieImpl
for more infomartion regarding the http session cookie implementation.
Field Summary |
Fields inherited from interface oracle.jbo.common.ampool.SessionCookie |
FORCE_RELEASE_MODE, MANAGED_RELEASE_MODE, NULL_PASSIVATION_ID, REMOVE_RESOURCE, RESERVED_MANAGED_RELEASE_MODE, RESERVED_UNMANAGED_RELEASE_MODE, SHARED, SHARED_MANAGED_RELEASE_MODE, SHARED_RELEASE_MODE, SHARED_UNMANAGED_RELEASE_MODE, STATE_MANAGED, STATE_UNMANAGED, UNSHARED |
Constructor Summary | |
SharedSessionCookieImpl(java.lang.String applicationId, java.lang.String sessionId, ApplicationPool pool) This constructor may be used if the sessionId is already known. |
Method Summary | |
boolean |
isFailoverEnabled() Indicates that session application module state should be persisted to secondary storage immediately upon a managed release. |
void |
releaseApplicationModule(int releaseFlags, long waitTimeout) Release an application module for reuse. |
protected void |
removeFromPool() |
Methods inherited from class oracle.jbo.http.HttpSessionCookieImpl |
afterApplicationModuleRelease, beforeApplicationModuleRelease, readValue, timeout, useApplicationModule, valueBound, valueUnbound, writeValue |
Methods inherited from class oracle.jbo.common.ampool.SessionCookieImpl | ||||||||||||||||||||||||
copyInto, equals, getApplicationId, getClientEnvironment, getClientEnvironment, getEnvConfigurationName, getEnvInfoProvider, getEnvironment, getEnvironment, getLastUpdate, getMostRecentStackId, getPassivationId, getPoolSignature, getProperty, getReservedPassivationId, getSessionId, getSSOSubscriber, getSSOUserName, getSyncLock, getThreadRefCount, getUserData, getValue, hashCode, isActivationRequired, isActivationRequired, isApplicationModuleReleased, isApplicationModuleReleasedByThread, isApplicationModuleReserved, isConnectionPoolingEnabled, isResetNonTransactionalState, parsePassivationId, parseSessionId, releaseApplicationModule
|