Identity key for a session. Normally there is one session per thread, but applications that need to maintain session context across multiple network requests serviced on different threads can access and carefully modify their session contexts using SessionID. See {@link Persistit#getSessionId()} and{@link Persistit#setSessionId(SessionId)}.
A SessionId instance holds a reference to the Thread
currently associated with it; initially this this the thread that created the SessionId. The setSessionId
method reassigns the thread field. The {@link #isAlive()} method indicates whether the associated thread isalive. The {@link Persistit#cleanup()} method cleans up all transactionresources for SessionId
instances whose threads are no longer alive.
A session is used to maintain state, including the {@link Transaction}context and map of cached {@link Exchange} maintained by{@link Persistit#getExchange(String,String,boolean)}. Therefore care must be taken to limit the maximum number of SessionId
instances created during the lifetime of a Persistit
instance and to manage them appropriately.
|
|
|
|