Connection Pooling and reusing connections on republish of Tomcat webapp within IDE [message #202364] |
Tue, 16 October 2007 14:58  |
Eclipse User |
|
|
|
Good afternoon,
I am experiencing problems with Tomcat and commons-dbcp when my Tomcat
webapp gets restarted / republished from within the IDE.
As far as I can tell the connections in the connection pool are not being
closed when the webapp gets republished.
Has anyone else expierence this problem and is there a work-around?
Thanks in advance.
Whatty
|
|
|
|
|
Re: Connection Pooling and reusing connections on republish of Tomcat webapp within IDE [message #202553 is a reply to message #202546] |
Wed, 17 October 2007 12:30   |
Eclipse User |
|
|
|
Just to make sure, where is this context.xml located? Also, which
version of WTP and have you changed anything about how the default
server comes configured.
Again, I haven't done a lot with connection pools, but I assume the
closing of connections you are looking for is dependent on the pool
being garbage collected. Even if the pool is being loaded in the
webapp's classloader and not in one of the server's classloaders, the
old webapp classloader can fail to garbage collect for a number of
reasons. Some of these reasons are bugs internal to Tomcat.
Unfortunately, I've lost track of which Tomcat versions fix which issues.
Larry
Steve Whatmore wrote:
> You are correct, I am in fact referring to reloading.
>
> This is how I have the resource defined
>
> <!-- Connection Pooling Resource Definition -->
> <resource-ref>
> <description>Data Source Connection Pool</description>
> <res-ref-name>jdbc/sybase</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Application</res-auth>
> <res-sharing-scope>Shareable</res-sharing-scope>
> </resource-ref>
>
> and in the context.xml I have the following (some details removed)
>
> <Context>
>
> <!-- Default set of monitored resources -->
> <WatchedResource>/WEB-INF/web.xml</WatchedResource>
>
> <Resource
> name="jdbc/sybase"
> auth="Application"
> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory "
> type="javax.sql.DataSource"
> driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
> .... <etc>
> />
>
> </Context>
>
> Thus, if I can the <res-auth> attribute to the following that should do it
> correct?
>
> <res-auth>Container</res-auth>
>
> Whatty
>
> "Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
> news:ff4vvf$7vo$1@build.eclipse.org...
>> I assume by "webapp gets restarted" you referring to what is more commonly
>> referred to as "reloading". Any reloading triggered by WTP publishing is
>> under the control of Tomcat and if that's not working, you may have to
>> resort to restarting the server. I haven't done a lot with connection
>> pooling, but I believe the easiest way to cause this is to configure the
>> connection pool as a global resource. Then that pool would be unaffected
>> by any webapp reloading. Is this the case in your configuration?
>>
>> Cheers,
>> Larry
>>
>> Steve Whatmore wrote:
>>> Good afternoon,
>>>
>>> I am experiencing problems with Tomcat and commons-dbcp when my Tomcat
>>> webapp gets restarted / republished from within the IDE.
>>>
>>> As far as I can tell the connections in the connection pool are not being
>>> closed when the webapp gets republished.
>>>
>>> Has anyone else expierence this problem and is there a work-around?
>>>
>>> Thanks in advance.
>>>
>>> Whatty
>
>
|
|
|
Re: Connection Pooling and reusing connections on republish of Tomcat webapp within IDE [message #202561 is a reply to message #202553] |
Wed, 17 October 2007 14:44  |
Eclipse User |
|
|
|
Context.xml is located in the META-INF directory and we are using the latest
version of WTP (2.0.1).
The version of Tomcat we are using is 5.5 and nothing special with our
configuration of Tomcat and the IDE.
BTW, I have changed the <res-auth> to Container
<res-auth>Container</res-auth>
and it seems to be behaving (although that could be a side-effect of
something else)
Thanks for the assistance.
Whatty
"Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
news:ff5dak$63v$1@build.eclipse.org...
> Just to make sure, where is this context.xml located? Also, which version
> of WTP and have you changed anything about how the default server comes
> configured.
>
> Again, I haven't done a lot with connection pools, but I assume the
> closing of connections you are looking for is dependent on the pool being
> garbage collected. Even if the pool is being loaded in the webapp's
> classloader and not in one of the server's classloaders, the old webapp
> classloader can fail to garbage collect for a number of reasons. Some of
> these reasons are bugs internal to Tomcat. Unfortunately, I've lost track
> of which Tomcat versions fix which issues.
>
> Larry
>
> Steve Whatmore wrote:
>> You are correct, I am in fact referring to reloading.
>>
>> This is how I have the resource defined
>>
>> <!-- Connection Pooling Resource Definition -->
>> <resource-ref>
>> <description>Data Source Connection Pool</description>
>> <res-ref-name>jdbc/sybase</res-ref-name>
>> <res-type>javax.sql.DataSource</res-type>
>> <res-auth>Application</res-auth>
>> <res-sharing-scope>Shareable</res-sharing-scope>
>> </resource-ref>
>>
>> and in the context.xml I have the following (some details removed)
>>
>> <Context>
>>
>> <!-- Default set of monitored resources -->
>> <WatchedResource>/WEB-INF/web.xml</WatchedResource>
>>
>> <Resource
>> name="jdbc/sybase"
>> auth="Application"
>> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory "
>> type="javax.sql.DataSource"
>> driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
>> .... <etc>
>> />
>>
>> </Context>
>>
>> Thus, if I can the <res-auth> attribute to the following that should do
>> it correct?
>>
>> <res-auth>Container</res-auth>
>>
>> Whatty
>>
>> "Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
>> news:ff4vvf$7vo$1@build.eclipse.org...
>>> I assume by "webapp gets restarted" you referring to what is more
>>> commonly referred to as "reloading". Any reloading triggered by WTP
>>> publishing is under the control of Tomcat and if that's not working, you
>>> may have to resort to restarting the server. I haven't done a lot with
>>> connection pooling, but I believe the easiest way to cause this is to
>>> configure the connection pool as a global resource. Then that pool
>>> would be unaffected by any webapp reloading. Is this the case in your
>>> configuration?
>>>
>>> Cheers,
>>> Larry
>>>
>>> Steve Whatmore wrote:
>>>> Good afternoon,
>>>>
>>>> I am experiencing problems with Tomcat and commons-dbcp when my Tomcat
>>>> webapp gets restarted / republished from within the IDE.
>>>>
>>>> As far as I can tell the connections in the connection pool are not
>>>> being closed when the webapp gets republished.
>>>>
>>>> Has anyone else expierence this problem and is there a work-around?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Whatty
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04865 seconds