Sharing JCo connection pool across different Web apps

Sharing JCo connection pool across different Web apps

How do I share a JCo connection pool across different Web applications?

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

The JCo API states that a named pool manager can only exist once per JVM. This does not mean that you can't have multiple pool managers, only that when a pool manager is assigned a name on creation, this name must be unique among any other existing pool managers.

When deploying multiple Web applications, each must reside within is own session context in the application server. If not, then you are likely you get unauthorized sharing of resources between different applications that you did not intend.

In order to share a pool manager, you must use a classloader to load a class that creates the pool manager with the attributes you designate (name, size, etc.). How you create and configure this classloader depends on the Java application server being used. Unless the classloader is in a shared context, your individual Web applications will not be able to "se" it.

This was first published in April 2004