users@javaee-spec.java.net

[javaee-spec users] Re: Standard properties

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Thu, 19 Feb 2015 18:22:56 +0100

Hi Adam,

On Thu, Feb 19, 2015 at 5:00 PM, Adam Bien <abien_at_adam-bien.com> wrote:
> At least min <-> max connection pool settings should be provided.

min and max are already there ;)

This is approximately the list of standardized settings now that are
intended to be passed to the pool:

 /**
     * Number of connections that should be created when a connection pool
     * is initialized.
     * <p>
     * Default is vendor-specific
     * @since 1.1
     */
    int initialPoolSize() default -1;

    /**
     * Maximum number of connections that should be concurrently allocated for a
     * connection pool.
     * <p>
     * Default is vendor-specific.
     * @since 1.1
     */
    int maxPoolSize() default -1;

    /**
     * Minimum number of connections that should be allocated for a
     * connection pool.
     * <p>
     * Default is vendor-specific.
     * @since 1.1
     */
    int minPoolSize() default -1;

    /**
     * The number of seconds that a physical connection
     * should remain unused in the pool before the
     * connection is closed for a connection pool.
     * <p>
     * Default is vendor-specific
     * @since 1.1
     */
    int maxIdleTime() default -1;

    /**
     * The total number of statements that a connection pool should keep open.
     * A value of 0 indicates that the caching of statements is disabled for
     * a connection pool.
     * <p>
     * Default is vendor-specific
     * @since 1.1
     */
    int maxStatements() default -1;

See http://docs.oracle.com/javaee/7/api/javax/annotation/sql/DataSourceDefinition.html

(xml variant is pretty much idential)

Kind regards,
Arjan



>
>
> I'm not sure about validation,
>
> cheers,
>
> adam
>
>
> well was not the proposal at all. The point is to ensure datasource
> are usable in something else than PoC.
>
> For it you need 2 things mainly:
> - basic size config
> - eviction/validation
>
> Last is missing and could be standardize a minimum (even if it is
> without an evition thread and only on return and on borrow).
>
> wdyt?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>