You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Sanjiva Weerawarana <sa...@opensource.lk> on 2006/03/22 13:14:00 UTC

Re: [Axis2] Some problems in the client side with multiple threading.

On Wed, 2006-03-22 at 07:01 -0500, Srinath Perera wrote:
> Hi Eran;
> 
> IMHO Stateless does not talk only about across multiple invocations,
> just like EJB it simply say user should not be looking at the states
> on the Handler anytime.

+1.

> On 3/21/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> >
> > I have not kept this attribute across multiple invocations of the same
> > handler. Its *within* one invocation of that handler.

Are you keeping an instance var that holds some value across two or more
methods in the same handler? That is, do you use an instance var to pass
some state from the main method to other methods? If so that will lead
to problems and can easily be fixed with params.

If not I'm confused what the offending thing is; can someone point out
the code please.

> > Anyway, if this leads to synchronization issues, let me keep this in the
> > message context.

That'll work; of course.

Sanjiva.



Re: [Axis2] Some problems in the client side with multiple threading.

Posted by Srinath Perera <he...@gmail.com>.
cool!!   :), when I looked at the code yesterday (when jaliya
mentioned the problem) I saw it and thought it is better to discuss it
in the list ... so other deveopers get to know about the stateless
assumptions we made.
Thanks
Srinath




On 3/22/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> You being one of the pioneers in Axis2, how can you talk abt some old
> code ?  ;-) Get an svn up and you will see they are no more like that.
>
> Srinath Perera wrote:
> >>> On 3/21/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> >>>
> >>>> I have not kept this attribute across multiple invocations of the same
> >>>> handler. Its *within* one invocation of that handler.
> >>>>
> >> Are you keeping an instance var that holds some value across two or more
> >> methods in the same handler? That is, do you use an instance var to pass
> >> some state from the main method to other methods? If so that will lead
> >> to problems and can easily be fixed with params.
> >>
> >> If not I'm confused what the offending thing is; can someone point out
> >> the code please.
> >>
> > the class is org.apache.axis2.handlers.addressing.AddressingOutHandler,
> >
> > offending part is (following is yesterdays code) Handler attributes
> > addressingNamespaceObject and msgCtxt .. they remember things between
> > the method invocations (addressingNamespaceObject accsessed by most
> > method without passing it in .. e.g.
> > processToEPRReferenceInformation(....)) and run in to trouble
> >
> > anothor thought .. we should be careful when hanging to the
> > messagecontext from some instance varaible as that might lead to
> > memeory leaks if object  (e.g. Handler) is never garbage collected
> >
> > Thanks
> > Srinath
> >
> > public class AddressingOutHandler extends AddressingHandler {
> >    ..............
> >     protected OMNamespace addressingNamespaceObject;
> >     private MessageContext msgCtxt;
> >     public void invoke(MessageContext msgContext) throws AxisFault {
> >                         .....................
> >     }
> >  }
> >
> > --
> > ============================
> > Srinath Perera:
> >    http://www.cs.indiana.edu/~hperera/
> >    http://www.bloglines.com/blog/hemapani
> >
> >
>
>


--
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani

Re: [Axis2] Some problems in the client side with multiple threading.

Posted by Eran Chinthaka <ch...@opensource.lk>.
You being one of the pioneers in Axis2, how can you talk abt some old 
code ?  ;-) Get an svn up and you will see they are no more like that.

Srinath Perera wrote:
>>> On 3/21/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>>>       
>>>> I have not kept this attribute across multiple invocations of the same
>>>> handler. Its *within* one invocation of that handler.
>>>>         
>> Are you keeping an instance var that holds some value across two or more
>> methods in the same handler? That is, do you use an instance var to pass
>> some state from the main method to other methods? If so that will lead
>> to problems and can easily be fixed with params.
>>
>> If not I'm confused what the offending thing is; can someone point out
>> the code please.
>>     
> the class is org.apache.axis2.handlers.addressing.AddressingOutHandler,
>
> offending part is (following is yesterdays code) Handler attributes
> addressingNamespaceObject and msgCtxt .. they remember things between
> the method invocations (addressingNamespaceObject accsessed by most
> method without passing it in .. e.g.
> processToEPRReferenceInformation(....)) and run in to trouble
>
> anothor thought .. we should be careful when hanging to the
> messagecontext from some instance varaible as that might lead to
> memeory leaks if object  (e.g. Handler) is never garbage collected
>
> Thanks
> Srinath
>
> public class AddressingOutHandler extends AddressingHandler {
>    ..............
>     protected OMNamespace addressingNamespaceObject;
>     private MessageContext msgCtxt;
>     public void invoke(MessageContext msgContext) throws AxisFault {
>                         .....................
>     }
>  }
>
> --
> ============================
> Srinath Perera:
>    http://www.cs.indiana.edu/~hperera/
>    http://www.bloglines.com/blog/hemapani
>
>   


Re: [Axis2] Some problems in the client side with multiple threading.

Posted by Srinath Perera <he...@gmail.com>.
> > On 3/21/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> > >
> > > I have not kept this attribute across multiple invocations of the same
> > > handler. Its *within* one invocation of that handler.
>
> Are you keeping an instance var that holds some value across two or more
> methods in the same handler? That is, do you use an instance var to pass
> some state from the main method to other methods? If so that will lead
> to problems and can easily be fixed with params.
>
> If not I'm confused what the offending thing is; can someone point out
> the code please.
the class is org.apache.axis2.handlers.addressing.AddressingOutHandler,

offending part is (following is yesterdays code) Handler attributes
addressingNamespaceObject and msgCtxt .. they remember things between
the method invocations (addressingNamespaceObject accsessed by most
method without passing it in .. e.g.
processToEPRReferenceInformation(....)) and run in to trouble

anothor thought .. we should be careful when hanging to the
messagecontext from some instance varaible as that might lead to
memeory leaks if object  (e.g. Handler) is never garbage collected

Thanks
Srinath

public class AddressingOutHandler extends AddressingHandler {
   ..............
    protected OMNamespace addressingNamespaceObject;
    private MessageContext msgCtxt;
    public void invoke(MessageContext msgContext) throws AxisFault {
                        .....................
    }
 }

--
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani