tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harry Mantheakis <>
Subject Re: Question about JNDI resources
Date Wed, 19 Jan 2005 10:30:28 GMT
I think I found the answer to my own question in the Commons DBCP

Under the JNDI section, the last paragraph states:


The reference to the DataSource could be maintained, for multiple
getConnection() requests.


Which seems clear enough. Phew :-)

Harry Mantheakis

>> It sounds plausible to hold onto the DataSource once you had it.
> I do, with PostgreSQL.
>> And then there is an issue of synchronization?
> Hmm... You got me thinking there :-)
> I have always assumed that a DataSource reference retrieved from a JNDI
> lookup is a singleton - IOW the connection pool created by Tomcat in
> response to a Context-Resource element in '/conf/server.xml' only contains
> one DataSource object.
> If that assumption is correct, then it seems logical to assume that vendor
> DataSource implementations *must* ensure their 'getConnection' methods are
> synchronized.
> But I do not like living with such assumptions (!) so I wonder if anyone
> might be kind enough to confirm whether or not JNDI DataSource references
> are singletons?
> Harry Mantheakis
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message