axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajal Shah" <>
Subject App Context & Services without EJBs
Date Fri, 25 Apr 2003 00:39:35 GMT
Here's a tricky situation and thought will poke everyone's brains on this..

I have a web service which doesn't use EJBs and J2EE framework. I still need
to do ConnectionPooling. Assume that I already have a ConnectionPooler
implementation. How do I set it up for my service. I am looking for the
ideal way to do it.. Here are some options, I could think ok, but don't have
answers for..

1. When service scope="Request" the connection pooler objects will be
reinstantiated with all requests and thus won't work.

2. When scope="Request" and my ConnectionPooler is "static". Will this setup
work? Would the static objects also have the scope constraint of "Request"
and thus get out of scope and not solving my problem?

3. When scope="Application", should I make the instance of ConnectionPooler
a member variable of my service and have it available for all requests that
way? The artifact of scope="Application" is that my service is instantiated
only once (which may be good).. but now when a request comes in and each
request thread run the endpoint method in a separate thread, do they access
the same private and public variables of the service object? A
multi-threading question - the local variables defined within the method is
still private to each request, right? (since the method is not defined as

4. Does service scope="Application" or a "static" ConnectionPooler behave
the same for my service to access the ConnectionPooler.. I understand the
implication of my Service object instantiation when scope=Application.


View raw message