You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ma...@t-systems.com on 2008/04/03 13:30:31 UTC

[Axis2][1.3] soapsession management with serviceGroup

Hi all,

I have read different mailings in this list, but they did not answer my
questions about soapsessions.

Here is my scenario. I have two services deployed in a single
servicegroup. I now have setup a client which calls the services and I
can see that the ServiceGroupContext stays the same in the different
services.

So here are my two questions:
1. Where am I supposed to store my session information? Is it the
ServiceGroupContext? Am I supposed to create a SessionContext and store
in the ServiceGroupContext?

2. I want to do some tidying up at the termination of the soapsession. I
could use the destroy() methods in each service for the service-related
stuff. But where is the right place to tidy up resources belonging to
the whole serviceGroup, eg. database connections used by both services*?
Similarly, I want to do some initialization for the whole service group.

Can someone please help me or point me to a good session handling
description?

Thanks,
Matthias.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: [Axis2][1.3] soapsession management with serviceGroup

Posted by Ma...@t-systems.com.
Thanks for the fast answer, Deepal.
> > Hi all,
> >
> > I have read different mailings in this list, but they did not answer
my
> > questions about soapsessions.
> >
> 
> > Here is my scenario. I have two services deployed in a single
> > servicegroup. I now have setup a client which calls the services and
I
> > can see that the ServiceGroupContext stays the same in the different
> > services.
> >
> Ok.
> > So here are my two questions:
> > 1. Where am I supposed to store my session information?
> It depends , if you want to share resources across your services in
the
> service group then store in the servicegroupcontext else store in the
> service context.
> > Is it the
> > ServiceGroupContext? Am I supposed to create a SessionContext and
store
> > in the ServiceGroupContext?
> >
> If you store in ServiceGroupContext the all the services in that group
> can access that , where as if you store that in ServiceContext only
> that
> corresponding service can access that. SessionContext is totally
> different thing it only uses for transport session , for soap session
> you get NULL as SessionContext value.

Thank you for clarifying that the SessionContext only belongs to the
transport session scope. In order to store information
servicegroup-wide, I'll now use the ServiceGroupContext.

> > 2. I want to do some tidying up at the termination of the
soapsession.
> At the moment we do not have a way to do that. Your session get
> terminated automatically unless you touch your services for sometime
> (that time is configurable in axis2.xml)

Ok, this would be a very practicable feature for a newer release. I'll
open a feature request in JIRA or have a look if there is already one.

> > I
> > could use the destroy() methods in each service for the service-
related
> > stuff. But where is the right place to tidy up resources belonging
to
> > the whole serviceGroup, eg. database connections used by both
services*?
> > Similarly, I want to do some initialization for the whole service
group.
> >
> For that there is something called ServiceLifeCycle class , that will
> help you to do that , please have a following article to get some
> understanding about that.
> 
> http://www.developer.com/db/article.php/3735771

Thank you for your article. It might be helpful in scenarios where I
need initialization for a service which is meant to be application-wide.
In order to solve my problem with tidying up session-related resources
for a servicegroup, I am thinking about calling an external tidyUp()
method in the destroy() method of each service and store in the
serviceGroupContext if it is still necessary to call the tidyUp()
method, so that this is called only once.
What do you think about it? Would that be a good solution? How are other
people out there realizing such scenarios?

Thanks,
Matthias.




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2][1.3] soapsession management with serviceGroup

Posted by Deepal Jayasinghe <de...@opensource.lk>.
> Hi all,
>
> I have read different mailings in this list, but they did not answer my
> questions about soapsessions.
>   

> Here is my scenario. I have two services deployed in a single
> servicegroup. I now have setup a client which calls the services and I
> can see that the ServiceGroupContext stays the same in the different
> services.
>   
Ok.
> So here are my two questions:
> 1. Where am I supposed to store my session information? 
It depends , if you want to share resources across your services in the 
service group then store in the servicegroupcontext else store in the 
service context.
> Is it the
> ServiceGroupContext? Am I supposed to create a SessionContext and store
> in the ServiceGroupContext?
>   
If you store in ServiceGroupContext the all the services in that group 
can access that , where as if you store that in ServiceContext only that 
corresponding service can access that. SessionContext is totally 
different thing it only uses for transport session , for soap session 
you get NULL as SessionContext value.
> 2. I want to do some tidying up at the termination of the soapsession. 
At the moment we do not have a way to do that. Your session get 
terminated automatically unless you touch your services for sometime 
(that time is configurable in axis2.xml)
> I
> could use the destroy() methods in each service for the service-related
> stuff. But where is the right place to tidy up resources belonging to
> the whole serviceGroup, eg. database connections used by both services*?
> Similarly, I want to do some initialization for the whole service group.
>   
For that there is something called ServiceLifeCycle class , that will 
help you to do that , please have a following article to get some 
understanding about that.

http://www.developer.com/db/article.php/3735771

Thank you!
Deepal



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org