users@glassfish.java.net

Re: What is the official GlassFish position on which kind of DataSources to use?

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Thu, 11 Oct 2012 13:53:13 -0700

On Wed, Oct 10, 2012 at 11:22 AM, Laird Nelson <ljnelson_at_gmail.com> wrote:

> When setting up a connection pool, I can (if my driver supports it) choose
> to expose the connections as javax.sql.DataSources,
> javax.sql.ConnectionPoolDataSources or javax.sql.XADataSource.
>
> After uncovering a state of affairs on the larger web that can best be
> described as pure abject confusion punctuated here and there by misguided
> folklore, I realized that no one really has the answer, and that it is
> going to be an application-server-dependent issue, whether it was defined
> as such or not.
>

My (still unanswered) StackOverflow question:
http://stackoverflow.com/questions/12826191/in-an-application-server-environment-should-one-prefer-javax-sql-datasource-or

It *seems* that one should always use ConnectionPoolDataSource (or
XADataSource) when one's driver supports it. It *seems* like at the
data-source-setup stage one should not deliberately expose one's data
source (little-d, little-s) as a javax.sql.DataSource if one has an
alternative. Is that correct?

Best,
Laird

-- 
http://about.me/lairdnelson