Vikram,
I think, the state (the value, this variable points to) is not guaranteed to be 
consistent.
If some other client connects to this SLSB and stores some difft value, you would 
loose it in next invocation. 
>Am i not storing the state by doing so
By this, you could be maintaining state till the duration of your current invocation 
stack only. 
Once your invocation is over, you may loose the value you have stored
In the String. It is not guaranteed, next time if you invoke home.create(), container 
would return you the same instance, Instead container may choose to give you handle to 
any 
random bean instance!! Hence the state is not (guaranteed) to be carried over multiple 
invocations!!!. You are just trying to 'fool' the container... :)
Also, check some appservers may use "pass by ref" semantics in local JVM, to optimize.
Hope it helps.
Cheers,
BJ


-----Original Message-----
From: Vikram Naik [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 12, 2003 6:06 PM
To: [EMAIL PROTECTED]
Subject: Query for SLSB.


Hello All,

    I wanted to clear out one query regarding SLSB, and there is not better place than 
this list to do so ...

1) Suppose I  have a SessionBean containing an instance member say some string, which 
is initialized in the ejbCreate method.
2) The SessionBean is deployed as a Stateless Type .
3) Now i use the string value stored in instance member in one of the business methods.
4) The string value is not mutated, but just used as constant which has to be 
initiated in ejbCreate.
5) Everything goes fine .


The issue is the behaviour of the Bean ... I have deployed it as a stateless bean than 
why am i able to use the string value stored in the instance field ... Am i not 
storing the state by doing so ...

I am using JBoss 3.2.1 as my ejb container.

Please comment.

Regards,
Vikram Naik

===========================================================================
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