Class TransactionReconnectionEvent
java.lang.Object
io.hypersistence.optimizer.core.event.AbstractEvent
io.hypersistence.optimizer.hibernate.event.connection.ConnectionEvent
io.hypersistence.optimizer.hibernate.event.connection.TransactionReconnectionEvent
- All Implemented Interfaces:
DurationAwareEvent,Event,Serializable
The
TransactionReconnectionEvent indicates that a JDBC Connection
is borrowed multiple times during the lifetime of a given JPA or Hibernate transaction.
Ideally, you should borrow a JDBC Connection from the pool only once
when executing a JPA or Hibernate transaction.- 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
ConstructorsConstructorDescriptionTransactionReconnectionEvent(long connectionUsageTimeNanos, String transactionStatus) 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 thisEventGet the transaction status at the moment the connection was released.Methods 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
-
TransactionReconnectionEvent
Instantiate the event using the provided parameters.- Parameters:
connectionUsageTimeNanos- connection usage timetransactionStatus- 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
-
getTransactionStatus
Get the transaction status at the moment the connection was released.- Returns:
- transaction status
-
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
-