Class SessionFlushTimeoutEvent
java.lang.Object
io.hypersistence.optimizer.core.event.AbstractEvent
io.hypersistence.optimizer.hibernate.event.session.SessionEvent
io.hypersistence.optimizer.hibernate.event.session.SessionFlushTimeoutEvent
- All Implemented Interfaces:
DurationAwareEvent,Event,Serializable
The
SessionFlushTimeoutEvent indicates that the current Persistence Context (EntityManager or Session)
has been flushed for more than the maximum allowed time threshold, which is given by the Config.Property.Session.FLUSH_TIMEOUT_MILLIS property value.
The more entities the current Persistence Context is managing, the longer it takes to process the dirty checking mechanism and synchronize the entity state changes with the database.
The flush execution time impacts the overall transaction response time,
so you need to make sure that the current JPA EntityManager or Hibernate Session
doesn't contain a very large number of entities.
- Since:
- 2.2.0
- Author:
- Vlad Mihalcea
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.hypersistence.optimizer.core.event.Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionSessionFlushTimeoutEvent(long flushTimeNanos) Instantiate the event using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the duration, in milliseconds, associated with thisEvent.longGet the HibernateSessionflush execution time in milliseconds.longGet the HibernateSessionflush execution time in nanoseconds.Get theEvent.Priorityof thisEventMethods inherited from class io.hypersistence.optimizer.core.event.AbstractEvent
getInfoUrlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.hypersistence.optimizer.core.event.Event
getInfoUrl
-
Constructor Details
-
SessionFlushTimeoutEvent
public SessionFlushTimeoutEvent(long flushTimeNanos) Instantiate the event using the provided parameters.- Parameters:
flushTimeNanos- session flush execution time
-
-
Method Details
-
getFlushTimeNanos
public long getFlushTimeNanos()Get the HibernateSessionflush execution time in nanoseconds.- Returns:
- Hibernate
Sessionflush execution time in nanoseconds
-
getFlushTimeMillis
public long getFlushTimeMillis()Get the HibernateSessionflush execution time in milliseconds.- Returns:
- Hibernate
Sessionflush execution time in milliseconds
-
getDurationMillis
public long getDurationMillis()Get the duration, in milliseconds, associated with thisEvent.- Specified by:
getDurationMillisin interfaceDurationAwareEvent- Returns:
- the duration, in milliseconds, associated with this
Event
-
getPriority
Get theEvent.Priorityof thisEvent- Specified by:
getPriorityin interfaceEvent- Returns:
- the
Event.Priorityof thisEvent
-
getDescription
- Specified by:
getDescriptionin interfaceEvent- Returns:
- the
Stringdescription of thisEvent
-