public class SessionId extends Object
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 Persistit.getSessionId()
and
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 isAlive()
method indicates whether the associated thread is
alive. The Persistit.cleanup()
method cleans up all transaction
resources for SessionId
instances whose threads are no longer
alive.
A session is used to maintain state, including the Transaction
context and map of cached Exchange
maintained by
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.
Copyright © 2025 Open Identity Platform Community. All rights reserved.