You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Morten J Nielsen <mo...@dk.ibm.com> on 2001/08/10 10:35:12 UTC

RE: Session Tracking question. --> Use og EJB

Hi Venkat,

Just a question about your use of EJB.

Am I right if I understood that you have a servlet for authentication which
stores a EJB in the servlet session object?

If this is the case then you may run into problems.

As a good guideline don't store complexe objects in the servlet session
object like an EJB. Regarding the EJB, then it may get out of synch with
the datasource.
Solution: if you only need one or two fields then copy them into an other
object stored in the session object, else store the key used to retrieve
the EJB afterwards and thrust the EJB container to catch the EJB for
performance (If you are using IBM WebSphere then this is no problem).

An other problem is that it sounds like you are using statefull session
beans which is considerably low on performance compared to stateless
session beans. Solution: Change your session beans to be stateless, then
you don't need to store a reference to the EJB.

My sugestion to you is that you store a userid in the servlet session
object, and when you call the SOAP service you include the userid in the
request. Though your business method will be able to retrieve the user
object and save the work.

Ragards

Morten Jul Nielsen
----------------------------------------------------------------------
Advisory IT-Specialist, Master of Science in Engineering - Informatics
Mobile e-business Practice
Business Innovation Services, IBM Global Services
Sortemosevej 21 - E1C, DK-3450 Allerød, Denmark
Phone: + 45 45239517,   Mobil : +45 23236116   Fax:       +45 45236805


                                                                                                                   
                    venkat reddy                                                                                   
                    <venkatr@Gandi       To:     "'soap-user@xml.apache.org'" <so...@xml.apache.org>           
                    va.com>              cc:                                                                       
                                         Subject:     RE: Session Tracking question.                               
                    01-08-2001                                                                                     
                    17:20                                                                                          
                    Please respond                                                                                 
                    to soap-user                                                                                   
                                                                                                                   
                                                                                                                   



Hi,
           How can we restrict the client to use the same 'Call' Object
over
and over for invoking different SOAP services that are deployed on a web
server? Is it by resetting the targetObjectURI and the method & parameters
of that 'Call' Object? If this is the case then it is limitation to what
SOAP can do under session scope. This means that the 'Call' Object is tied
to the SOAP Service that is of scope 'session' and not the client itself.
Well any ways this is not my problem child. My problem is something like
this.
           When a User logs in, a Servlet handles the authentication and
creates and EJB Object that is stored in the session object for that user.
I
need to access and invoke a business method on this EJB object some time
later when the user decides to save his work to the database. My question
is
how do I get the handle to this EJB Object, that is stored in the session
object, from my SAOP Service. Is there any way to access the session object
that was originally created by the servlet during user authentication from
a
SOAP Service?

Christian -- Thanks for the reply.

~Venkat