public class SessionTimeoutEvent extends SessionEvent implements DurationAwareEvent
SessionTimeoutEvent indicates that the current Persistence Context
has been running for more than the maximum allowed time threshold, which is given by the Config.Property.Session.TIMEOUT_MILLIS property value.
Long-running Session or EntityManager
should be avoided because they impact user experience, consume resources, and
prevent other concurrent requests from using the acquired resources (e.g., database connections).Event.Priority| Constructor and Description |
|---|
SessionTimeoutEvent(long sessionTimeNanos)
Instantiate the event using the provided parameters.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
|
long |
getDurationMillis()
Get the duration, in milliseconds, associated with this
Event. |
Event.Priority |
getPriority()
Get the
Event.Priority of this Event |
long |
getSessionTimeMillis()
Get the execution time of the JPA
EntityManager or Hibernate Session in milliseconds. |
long |
getSessionTimeNanos()
Get the execution time of the JPA
EntityManager or Hibernate Session in nanoseconds. |
getInfoUrlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInfoUrlpublic SessionTimeoutEvent(long sessionTimeNanos)
sessionTimeNanos - session execution timepublic long getSessionTimeNanos()
EntityManager or Hibernate Session in nanoseconds.EntityManager or Hibernate Session in nanosecondspublic long getSessionTimeMillis()
EntityManager or Hibernate Session in milliseconds.EntityManager or Hibernate Session in millisecondspublic long getDurationMillis()
Event.getDurationMillis in interface DurationAwareEventEventpublic Event.Priority getPriority()
Event.Priority of this EventgetPriority in interface EventEvent.Priority of this Eventpublic String getDescription()
getDescription in interface EventString description of this EventCopyright © 2026. All rights reserved.