• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Intercepting TomCat 5

 
Yuma Shankar
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a development environment running TomCat (within Eclipse).

We use a connection pool. And everytime we build our app, the context reloads and if we have any existing connections at that point, they do not get cleared up or reused. So, the only way to clear them up right now is to restart TomCat.

As a work around, I was looking into implementing a Context Interceptor where I could put the connection clean up code in the context reload method. I find that TomCat 3 had a BaseInterceptor class in org.apache.tomcat.core. But, I cannot find any Interceptor classes to extend in TomCat5.

Any ideas?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked into using a context listener?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[klunk]


While you're at it, you might want to look into container managed connection pooling. This should lift a lot of these types of troubles from your shoulders.
 
Yuma Shankar
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. I will look into both the options suggested-the listener and making the connection pooling container based.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic