On 4/27/07, Srinivas V. <[EMAIL PROTECTED]> wrote:
Thanks for all the responses on this. The basic doubt I had was whether the
JNDI lookup would create a new data-source on each lookup or just return the
previously created one. A number of you had said that the latter was true.
The reason I wasn't sure about that was because I'm creating C3P0
ComboPooledDataSource objects using the BeanFactory factory. And the docs
here state that each lookup creates a new bean, which in my case is a new
data-source:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#Generic%20
JavaBean%20Resources
I decided to test this by adding some logging in the various servlet init()
methods to dump the C3P0 object returned from the lookup. The log output
suggests that the same object is being returned back i.e. only one
ComboPoolDataSource object is being used by both servlets. This is good for
me. But it doesn't explain the discrepancy with the docs.
Hi Srinivas,
I don't see any discrepancy based on David's point in the above post:
MyBean bean = (MyBean) envCtx.lookup("bean/MyBeanFactory"); , doesn't
create a new
bean.
FYI: I refer to this doc:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
specifically for JDBC Connection pooling , instead of the above link
you referenced as it closely concerns with JDBC and not general JNDI.
But both documents are good.
Srinivas
-Regards
Rashmi
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]