Please! Anyone who can help!!
I'm using the PooledConnection (*See end of this post for info) with a MySQL JDBC Driver and the MS SQL Server JDBC Driver. Both fully implement this interface. However, both also have a major lack of documentation (MS's driver doesn't even have JavaDoc so I actually had to GUESS at their interfaces!! - there's non-ConnectionPoolDataSource methods I needed to call to set it up)
I'm unable to find what exactly is supposed to happen when I call getPooledConnection and getConnection. What I mean is: when I call PooledConnection from different Threads, do they still pull from the same pool, or does each different Threaded call to getPooledConnection() return a different pool? OR, does EVERY call (even in the same
Thread) to getPooledConnection() return a different physical connection pool? In other words, in that last scenario, I should save the PooledConnection in ServletContext and just call "getConnection()" on THAT same instance from many different threads. Is it thread safe?
If a pool can only be applied to one Thread, then I get no benefit out of this as every new request will generate a new pool, thus going back to the whole: one new request, one new connection paradigm.
Please, anyone help!
*
javax.sql.ConnectionPoolDataSource
"A factory for PooledConnection objects...When a DataSource
class is implemented to work with a ConnectionPoolDataSource
implementation, all of the connections produced by instances
of that DataSource class will automatically be pooled
connections."
javax.sql.PooledConnection
"An object that provides hooks for connection pool management.
A PooledConnection object represents a physical connection to
a data source. The connection can be recycled rather than being
closed when an application is finished with it, thus reducing
the number of connections that need to be made.
"An application programmer does not use the PooledConnection
interface directly; rather, it is used by a middle tier
infrastructure that manages the pooling of connections."
(The quotes are from Sun)