axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <>
Subject AW: Field level variables
Date Mon, 13 Sep 2010 13:02:47 GMT

Jeff is correct; 
in service.xml there is  scope="soapsession"  
This makes axis2 creating a new instance of your service class 
for each new user-session. 

For that your service class demands 3 more methods 

public void init(ServiceContext sCtx) throws XMLStreamException { 
	. . .
public void destroy(ServiceContext sCtx) throws XMLStreamException { 
	. . .
public void setOperationContext(OperationContext oCtx) { 
	. . .


In axis2.xml at ./axis2/WEB-INF/conf you have to set-up ConfigContextTimeoutInterval to a
much bigger value. 
The value is the TimeoutInterval in ms at which the users client has to send latest the next
to keep the service class instance (the service providing object a-life).

This is what we understand as "LONG LASTING USER SESSIONMS" and with AXIS2-1.2 it works greate.

    <!--This will give out the timeout of the configuration contexts, in milliseconds-->
    <parameter name="ConfigContextTimeoutInterval">28800000</parameter>

You can look to the TimeoutInterval as the life-time of your instance, after which destroy()
gets called.
This is true unless you the user-session places a next request before this TimeoutInterval
at which time the TimeoutInterval starts from 0.

That is what we use with our SpezplaService and AXIS2-1.2 
and I have no confirmation and did not yet test that the same is true for AXIS2-1.5.x

Somewhere in the Oxygen-Tank Area there is a more precise document.


-----Ursprüngliche Nachricht-----
Von: Jeff Greif [] 
Gesendet: Freitag, 20. August 2010 18:03
An: Meeusen, Christopher W.
Betreff: Re: Field level variables

This is configurable in the deployment descriptor.  The <service>
element has an attribute "scope".  One allowed value of this attribute
creates an instance of the implementing class for each invocation.


On 8/20/2010 7:18 AM, Meeusen, Christopher W. wrote:
> Let me try to ask this another way.  Say I have a class and this class
has a web service method in it.  What does the lifecycle of this class look like?  Is there
a new instance of MyService instantiated for each request to one of the methods within it,
or is one instance of this class instantiated and multiple threads use the same instance of
the class?
> -----Original Message-----
> From: Meeusen, Christopher W. 
> Sent: Wednesday, August 18, 2010 5:45 PM
> To:
> Cc:
> Subject: Re: Field level variables
> My main concern is if this is thread safe.  Are pojos re entrant in axis2-1.3?
> On Aug 18, 2010, at 17:21, "Meeusen, Christopher W." <
 > wrote:
>> I’m looking through some of my colleagues code and I’m noticing some 
>> field level variables declared inside one of our pojos.  Someth ing 
>> similar to this:
>> Public class classA
>> {
>>                 private classB aClassb;
>>                 Public classC[] aMethod()
>> {
>>                                 aClassb= new classB();
>> }
>> }
>> aMethod() is exposed as a web service and is called several thousand 
>> times per minute.  Is this thread safe?  I know it is bad to have 
>> field level variables unless they are really needed but I don’t know  
>> if this behavior is ok inside of the axis2 environment.
>> Thanks,
>> Chris

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message