All Downloads are FREE. Search and download functionalities are using the official Maven repository.

atasources.datasources.1.0.0.source-code.reference.conf Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
dataSources {
    connection-pool-defaults {
        # Connections that have been abandoned (timed out) wont get closed and reported up unless
        # the number of connections in use are above the percentage defined by abandon-when-percentage-full.
        # The value should be between 0-100.
        # The default value is 0, which implies that connections are eligible for closure as soon as
        # remove-abandoned-timeout has been reached.
        abandon-when-percentage-full = 0

        # Set to yes if you wish that calls to getConnection should be treated fairly in a true FIFO fashion.
        fair-queue = yes

        # default auto-commit state of connections created by this pool. If not specified (i.e. not included
        # in your configuration), then the driver's default auto commit setting will be used.
        # default-auto-commit = no

        # during connection creation the method java.sql.Connection#setCatalog(String) will be called
        # with the set value. If not specified (i.e. not included in your configuration), then the
        # driver's default catalog will be used
        # default-catalog = some catalog

        # whether or not connections should be read only. If not specified (i.e. not included in your
        # configuration), then the driver's default read-only setting will be used
        # default-read-only = no

        # The default transaction isolation level for new connections. If not specified (i.e. not
        # included in your configuration) or the value UNKNOWN_TRANSACTION_ISOLATION is used, then the
        # driver's default isolation level will be used.
        # The following values are supported (case insensitive)
        #   TRANSACTION_NONE
        #   TRANSACTION_READ_UNCOMMITTED
        #   TRANSACTION_READ_COMMITTED
        #   TRANSACTION_REPEATABLE_READ
        #   TRANSACTION_SERIALIZABLE
        #   UNKNOWN_TRANSACTION_ISOLATION
        # Please note that just because you set the value to a specific isolation level, your RDBMS may
        # not support that level, and it could be raised, lowered, or throw an exception based on
        # the driver's preference.
        # default-transaction-isolation-level = UNKNOWN_TRANSACTION_ISOLATION

        # the number of connections that will be established when the connection pool is started.
        # If this value exceeds max-active, it will automatically be lowered to match max-active.
        # If this value is negative, it will be adjusted to 0
        initial-size = 10

        # Set if stack traces should be logged for application code which abandoned a Connection.
        # Logging of abandoned Connections adds overhead for every Connection borrow because a
        # stack trace has to be generated.
        log-abandoned = no

        # maximum number of active connections that can be allocated from this pool at the same time.
        # If this value is less than initial-size, initial-size will be lowered to match
        # This value must be greater than 0
        max-active = 100

        # maximum number of connections that should be kept in the idle pool if pool-sweeper-enabled
        # is false. If pool-sweeper-enabled is true, then the idle pool can grow up to max-active
        # and will be shrunk according to min-evictable-idle-time setting.
        max-idle = 100

        # maximum time that the pool will wait when there are no available connections and the
        # max-active has been reached for a connection to be returned
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 1 second. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        max-wait = 30 seconds

        # minimum amount of time an object must sit idle in the pool before it is eligible for eviction.
        # This is only used if pool-sweeper-enabled is true.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 1 second. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        min-evictable-idle-time = 60 seconds

        # minimum number of established connections that should be kept in the pool at all times.
        # The connection pool can shrink below this number if validation queries fail and connections
        # get closed. Default value is derived from initial-size. The idle pool will not shrink below
        # this value during an eviction run, hence the number of actual connections can be between
        # min-idle and somewhere between max-idle and max-active
        # min-idle = 10

        # set to yes to remove abandoned connections if they exceed the remove-abandoned-timeout.
        # If set to yes a connection is considered abandoned and eligible for removal if it has
        # been in use longer than the remove-abandoned-timeout and the condition for
        # abandon-when-percentage-full is met.
        # Setting this to true can recover db connections from applications that fail to close a connection.
        remove-abandoned = yes

        # time before a connection can be considered abandoned.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 60 seconds. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        remove-abandoned-timeout = 3 minutes

        # set to yes if objects will be validated before being borrowed from the pool. If the object fails to
        # validate, it will be dropped from the pool. If set to yes, you should set validation-query.
        test-on-borrow = no

        # set to yes if objects will be validated after being returned to the pool.  If the object fails to
        # validate, it will be dropped from the pool. If set to yes, you should set validation-query.
        test-on-return = no

        # set to yes if query validation should take place while the connection is idle. If the object fails to
        # validate, it will be dropped from the pool. If set to yes, you should set validation-query.
        test-while-idle = yes

        # time to sleep between runs of the idle connection validation, abandoned cleaner, and idle pool resizing.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 1 second. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        time-between-eviction-runs = 15 seconds

        # the SQL query that will be used to validate connections from this pool before returning them
        # to the caller or pool. If specified, this query does not have to return any data, it just
        # can't throw a SQLException
        # validation-query = "SELECT 1"

        # timeout before a connection validation queries fail. If not specified (i.e. not in your configuration
        # file), validation query timeouts are disabled.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 1 second. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        # validation-query-timeout = 5 seconds

        # custom query to be run when a connection is first created. This query only runs once per connection,
        # and that is when a new connection is established to the database. If a value is specified, it will
        # replace the validation-query during connection creation.
        # init-sql = "SET SOME_DB_FEATURE=1"

        # Set to yes if we should run the validation query when connecting to the database for the first
        # time on a connection. Normally this is always set to no, unless one wants to use the
        # validation-query as an init query. Setting an init-sql will override validation-query setting,
        # as the init-sql will be used instead of the validation query
        test-on-connect = no

        # time to keep this connection alive even when used. When a connection is returned to the pool,
        # the pool will check to see if the ((now - time-when-connected) > max-age) has been reached,
        # and if so, it closes the connection rather than returning it to the pool.
        # The default value is 0, which implies that connections will be left open and no age check
        # will be done upon returning the connection to the pool.
        # This is a useful setting for database sessions that leak memory as it ensures that the session
        # will have a finite life span.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 0. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        max-age = 0

        # Similar to remove-abandoned-timeout but instead of treating the connection as abandoned, and
        # potentially closing the connection, this simply logs the warning if log-abandoned is true. If
        # this value is 0, no suspect checking will be performed. Suspect checking only takes place if
        # the timeout value is larger than 0 and the connection was not abandoned or if abandon check
        # is disabled. If a connection is suspect a WARN message gets logged and a JMX notification gets
        # sent once.
        # You may use the following time units after the number
        #   ns, nanosecond, nanoseconds
        #   us, microsecond, microseconds
        #   ms, millisecond, milliseconds
        #   s, second, seconds
        #   m, minute, minutes
        #   h, hour, hours
        #   d, day, days
        # The minimum value is 0. There is no maximum except for common sense (do you really
        # want to wait a day?). If no time unit is given, it is assumed to be milliseconds.
        suspect-timeout = 0

        # Set to yes if you want the connection pool to commit any pending transaction when a connection
        # is returned. This is only used if default-auto-commit is false.
        commit-on-return = no

        # Set to yes if you want the connection pool to rollback any pending transaction when a connection
        # is returned. This is only used if default-auto-commit is false.
        rollback-on-return = no

        # set to yes, the connection will be wrapped with facade that will disallow the connection to be
        # used after java.sql.Connection#close is called. If set to yes, after java.sql.Connection#close
        # all calls except java.sql.Connection#close and java.sql.Connection#isClosed will throw an
        # exception.
        use-disposable-connection-facade = yes

        # Set to yes if you wish that errors from validation should be logged as error messages.
        log-validation-errors = no

        # Set to yes to have the pool to propagate interrupt state for interrupted threads waiting
        # for a connection.
        propagate-interrupt-state = yes

        # set to yes if you want to ignore error of connection creation while initializing the pool. A
        # value of false will cause the pool to not start when creating the initial pool.
        ignore-exception-on-preload = no

        # pool-sweeper-enabled is referenced several times in the above comments, but it is just a
        # make believe property. It cannot be set by you. It is considered set if the following is true
        #   enabled = time-between-eviction-runs > 0
        #   enabled = enabled && removed-abandoned == true && remove-abandoned-timeout > 0
        #   enabled = enabled || (test-while-idle == true && validation-query is set)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy