Class StatementlessConnectionEvent
java.lang.Object
io.hypersistence.optimizer.core.event.AbstractEvent
io.hypersistence.optimizer.hibernate.event.connection.ConnectionEvent
io.hypersistence.optimizer.hibernate.event.connection.StatementlessConnectionEvent
- All Implemented Interfaces:
DurationAwareEvent,Event,Serializable
The
StatementlessConnectionEvent indicates that a JDBC Connection
was borrowed without executing any SQL statement.
Borrowing a JDBC Connection from the pool without executing any SQL statement
should be avoided as it deprives other concurrent requests of using this connection.- Since:
- 2.3.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
ConstructorsConstructorDescriptionStatementlessConnectionEvent(long connectionUsageTimeNanos) Instantiate the event using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the usage time of the JDBCConnectionin milliseconds.longGet the usage time of the JDBCConnectionin nanoseconds.longGet the duration, in milliseconds, associated with thisEvent.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
-
StatementlessConnectionEvent
public StatementlessConnectionEvent(long connectionUsageTimeNanos) Instantiate the event using the provided parameters.- Parameters:
connectionUsageTimeNanos- connection usage time
-
-
Method Details
-
getConnectionUsageTimeNanos
public long getConnectionUsageTimeNanos()Get the usage time of the JDBCConnectionin nanoseconds.- Returns:
- the usage time of the JDBC
Connectionin nanoseconds
-
getConnectionUsageTimeMillis
public long getConnectionUsageTimeMillis()Get the usage time of the JDBCConnectionin milliseconds.- Returns:
- the usage time of the JDBC
Connectionin 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
-