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?
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