File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Object Pool in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Object Pool in Tomcat" Watch "Object Pool in Tomcat" New topic

Object Pool in Tomcat

Jaz Chana
Ranch Hand

Joined: Feb 19, 2008
Posts: 34
Hi Guys,

Simple request, but I'm sure the solution isn't so simple. I have a class that handles connections to another application that I am using. I call the app from my web application for every request that comes through. Now I wanted to create an object pool for this class so I dont have to create and destroy connections on every request, thus improving performance. Although I know how to use connection pooling with database connections I dont know how to create a generic object pool with tomcat. I am currently working through a generic object pool design pattern example. My question is, how do I configure tomcat to use a pool of any object type? Are there any examples of using generic object pools with tomcat on the net?

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Read this:
[ December 17, 2008: Message edited by: Bauke Scholtz ]
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Object pooling is now a serious performance loss for all but the most heavyweight of objects, and even then it is tricky to get right without introducing concurrency bottlenecks

Java theory and practice: Urban performance legends, revisited

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Object Pool in Tomcat
It's not a secret anymore!