Let me try to ask this another way. Say I have a class MyService.java 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: [email protected] Cc: [email protected] 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." <[email protected] > 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
