Interface DataSourceJdbcRuntimeConfig


  • public interface DataSourceJdbcRuntimeConfig
    • Method Detail

      • initialSize

        OptionalInt initialSize()
        The initial size of the pool. Usually you will want to set the initial size to match at least the minimal size, but this is not enforced so to allow for architectures which prefer a lazy initialization of the connections on boot, while being able to sustain a minimal pool size after boot.
      • minSize

        @WithDefault("0")
        int minSize()
        The datasource pool minimum size
      • maxSize

        @WithDefault("20")
        int maxSize()
        The datasource pool maximum size
      • backgroundValidationInterval

        @WithDefault("2M")
        Duration backgroundValidationInterval()
        The interval at which we validate idle connections in the background.

        Set to 0 to disable background validation.

      • foregroundValidationInterval

        Optional<Duration> foregroundValidationInterval()
        Perform foreground validation on connections that have been idle for longer than the specified interval.
      • acquisitionTimeout

        @WithDefault("5S")
        Optional<Duration> acquisitionTimeout()
        The timeout before cancelling the acquisition of a new connection
      • leakDetectionInterval

        @ConfigDocDefault("This feature is disabled by default.")
        Optional<Duration> leakDetectionInterval()
        The interval at which we check for connection leaks.
      • idleRemovalInterval

        @WithDefault("5M")
        Duration idleRemovalInterval()
        The interval at which we try to remove idle connections.
      • maxLifetime

        @ConfigDocDefault("By default, there is no restriction on the lifespan of a connection.")
        Optional<Duration> maxLifetime()
        The max lifetime of a connection.
      • transactionIsolationLevel

        Optional<io.agroal.api.configuration.AgroalConnectionFactoryConfiguration.TransactionIsolation> transactionIsolationLevel()
        The transaction isolation level.
      • extendedLeakReport

        @WithDefault("false")
        boolean extendedLeakReport()
        Collect and display extra troubleshooting info on leaked connections.
      • flushOnClose

        @WithDefault("false")
        boolean flushOnClose()
        Allows connections to be flushed upon return to the pool. It's not enabled by default.
      • detectStatementLeaks

        @WithDefault("true")
        boolean detectStatementLeaks()
        When enabled, Agroal will be able to produce a warning when a connection is returned to the pool without the application having closed all open statements. This is unrelated with tracking of open connections. Disable for peak performance, but only when there's high confidence that no leaks are happening.
      • newConnectionSql

        Optional<String> newConnectionSql()
        Query executed when first using a connection.
      • validationQuerySql

        Optional<String> validationQuerySql()
        Query executed to validate a connection.
      • poolingEnabled

        @WithDefault("true")
        boolean poolingEnabled()
        Disable pooling to prevent reuse of Connections. Use this when an external pool manages the life-cycle of Connections.
      • transactionRequirement

        Optional<io.agroal.api.configuration.AgroalConnectionPoolConfiguration.TransactionRequirement> transactionRequirement()
        Require an active transaction when acquiring a connection. Recommended for production. WARNING: Some extensions acquire connections without holding a transaction for things like schema updates and schema validation. Setting this setting to STRICT may lead to failures in those cases.
      • additionalJdbcProperties

        Map<String,​String> additionalJdbcProperties()
        Other unspecified properties to be passed to the JDBC driver when creating new connections.
      • telemetry

        @WithName("telemetry.enabled")
        @ConfigDocDefault("false if quarkus.datasource.jdbc.telemetry=false and true if quarkus.datasource.jdbc.telemetry=true")
        Optional<Boolean> telemetry()
        Enable OpenTelemetry JDBC instrumentation.