Class TransactionReconnectionEvent

All Implemented Interfaces:
DurationAwareEvent, Event, Serializable

public class TransactionReconnectionEvent extends ConnectionEvent implements DurationAwareEvent
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:
  • Constructor Details

    • TransactionReconnectionEvent

      public TransactionReconnectionEvent(long connectionUsageTimeNanos, String transactionStatus)
      Instantiate the event using the provided parameters.
      Parameters:
      connectionUsageTimeNanos - connection usage time
      transactionStatus - connection usage time
  • Method Details

    • getConnectionUsageTimeNanos

      public long getConnectionUsageTimeNanos()
      Get the usage time of the JDBC Connection in nanoseconds.
      Returns:
      the usage time of the JDBC Connection in nanoseconds
    • getTransactionStatus

      public String 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 JDBC Connection in milliseconds.
      Returns:
      the usage time of the JDBC Connection in milliseconds
    • getDurationMillis

      public long getDurationMillis()
      Get the duration, in milliseconds, associated with this Event.
      Specified by:
      getDurationMillis in interface DurationAwareEvent
      Returns:
      the duration, in milliseconds, associated with this Event
    • getPriority

      public Event.Priority getPriority()
      Get the Event.Priority of this Event
      Specified by:
      getPriority in interface Event
      Returns:
      the Event.Priority of this Event
    • getDescription

      public String getDescription()
      Get the String description of this Event
      Specified by:
      getDescription in interface Event
      Returns:
      the String description of this Event