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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
