Class RetryDriver.RetryConfig

java.lang.Object
org.pjdbc.drivers.RetryDriver.RetryConfig
Enclosing class:
RetryDriver

public static class RetryDriver.RetryConfig extends Object
Configuration holder for retry parameters, parsed once at connection time.
  • Constructor Details

    • RetryConfig

      public RetryConfig(String url)
  • Method Details

    • getMaxRetries

      public int getMaxRetries()
    • getInitialDelay

      public long getInitialDelay()
    • getMaxDelay

      public long getMaxDelay()
    • getBackoffMultiplier

      public double getBackoffMultiplier()
    • hasJitter

      public boolean hasJitter()
    • getRetryableSqlStates

      public Set<String> getRetryableSqlStates()
    • isRetryable

      public boolean isRetryable(SQLException e)
      Check if an exception is retryable based on SQL state.
    • isConnectionError

      public boolean isConnectionError(SQLException e)
      Check if an exception indicates a connection failure. Connection errors have SQL states starting with "08".
    • calculateDelay

      public long calculateDelay(int attempt)
      Calculate delay for a given retry attempt (0-indexed). Uses ThreadLocalRandom for thread-safe jitter generation.