It is quite valid for an EJB container to share one stateless session bean
amongst
all clients without using synchronization on method calls so in your example
the
value may not be 5 at the end.

This bean should definitely be declared as stateful.

---
Andy Grove
Chief Technology Officer
Orbware Ltd.

Phone: +44 (0) 1932 831124
Mobile: +44 (0) 7931 390085
Fax: +44 (0) 8700 548111
Email: [EMAIL PROTECTED]
Web: http://www.orbware.com

<vendor> OrCAS EJB Server now available from http://www.orbware.com
</vendor>

-----Original Message-----
From: Goud, Venkata <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: 21 June 2000 20:49
Subject: Re: Correct me if i'm wrong


>If it is true then it is inconsistent. Are you saying that for a stateless
>session bean you should not have any class members.
>
>class foo {
>        int i;
>        void foobar() {
>                i = 5;
>                somestatements; // some java statements which does not
>effect i
>                nextstatements; // r u saying that i may not be 5 here?
>        }
>}
>
>
>
>
>-----Original Message-----
>From: Juan Pablo Lorandi [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 3:16 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>Not necesarilliy true for stateless session beans. If the email value is a
>class member, defined OUTSIDE the method that's executing, then you can't
>assure this; tough such behavior could be considered a inconsistence in the
>container
>
>-----Original Message-----
>From: Goud, Venkata [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 2:51 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>Client creates VisitorInfo bean and then calls a method on it. The email
>value is undefined when you *just* enter into the method. If you have set
>the email value by calling some other method on the same bean, then also
>email value is undefined inside your method.
>If you set the email value inside the method, then until the method
finishes
>executing, email value should remain unchanged.
>
>-----Original Message-----
>From: Greg Robertson [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 1:32 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>I'll take a look at the spec.
>
>My question goes a little further though.  The object in question is called
>VisitorInfo.  It stores the values necessary to decide who should get the
>email.  The email is going to the wrong person based upon the information
>they are receiving (eg it appears 2 separate visitorinfos are being used at
>the same time but during the same call).  How would something like this
>occur?
>
>
>-----Original Message-----
>From: Goud, Venkata [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 1:10 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>Make the bean stateful.
>Please read about the Session bean's lifecycle in the specs
>regs
>Venkat
>
>-----Original Message-----
>From: Greg Robertson [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 12:46 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>The bean is stateless
>
>-----Original Message-----
>From: Goud, Venkata [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 11:48 AM
>To: [EMAIL PROTECTED]
>Subject: Re: Correct me if i'm wrong
>
>
>Is it stateless or stateful?
>
>-----Original Message-----
>From: Greg Robertson [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 21, 2000 11:43 AM
>To: [EMAIL PROTECTED]
>Subject: Correct me if i'm wrong
>
>
>I'm currently using Sun's RI for my EJB container.  I just want to verify
>that I am not making an incorrect assumption.  The situation that is
>occuring is a client attaches to my session bean which has some private
>variables.  This data is then used to determine which email address to send
>info to.  It appears that while the info is okay it is sometimes sending to
>the wrong email address.  This should not be due to multiple clients
>attaching at the same time with different info should it?  My understanding
>is that a session bean is created for each client.
>
>Thanks
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to