users@javaee-spec.java.net

[javaee-spec users] Re: Improving data-source element with facility for vendor specific pool settings?

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Fri, 13 Feb 2015 11:33:18 -0800

Here's how we expected this to work...

Any property that matches a JavaBeans property on the JDBC vendor's
DataSource implementation would be set on an instance of that class.
The rest of the properties, or maybe just all of the properties,
would be passed to the connection pool implementation to configure
the connection pool. Nothing other than the connection pool implementation
needed to know which properties were for the connection pool.

Is there a reason that won't work?

arjan tijms wrote on 02/09/15 13:37:
> In Java EE one can use the data-source element in web.xml, ejb-jar.xml
> and application.xml to define a data source.
>
> The Java EE XSD defines a set of standardized properties, and a
> general property element for vendor specific properties.
>
> Though the XSD doesn't separate them in any way, the standardized
> properties actually belong to two different groups:
>
> 1. Properties for the datasource, such as url, user and password
> 2. Properties for the connection pool, such as initial-pool-size,
> min-pool-size and max-pool-size
>
> The general vendor specific properties via the property element
> however seem to be intended for the datasource only. There's no
> element available to set vendor specific properties on the connection
> pool. In practice there often are such options. Just as an example
> JBoss has things like:
>
> * check-valid-connection-sql
> * use-strict-min
> * flush-strategy
>
> Etc.
>
> Other servers have similar properties for their connection pool and/or
> other ones.
>
> So what about adding a new child element to the data-source element:
>
> <pool-property> with the same <name> & <value> child elements as
> <property> currently has.
>
> This new element could then be used to set vendor specific properties
> on the connection pool.
>
> Thoughts?
>
> Kind regards,
> Arjan Tijms