tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harry Mantheakis <ha...@mantheakis.freeserve.co.uk>
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
documentation:


http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/datas
ources/package-summary.html


Under the JNDI section, the last paragraph states:


<quote> 


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


</quote>


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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message