Two Laptop Bag*
The moose likes EJB and other Java EE Technologies and the fly likes Fundamental doubt in SLB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Fundamental doubt in SLB" Watch "Fundamental doubt in SLB" New topic
Author

Fundamental doubt in SLB

Nijeesh Balan
Ranch Hand

Joined: Oct 09, 2000
Posts: 116
Hi,
I have a fundamental doubt in Stateless Session Beans. If i have instance variables in Stateless Session Beans will it behave like a stateful session bean inspite of mentioning session bean type as Stateless in the xml file.
Plz clarify.
Thanks in Advance,
Nijeesh.


Thanks & Regards,<br />Nijeesh.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

Yes, u can maintain the state using stateless session bean if the container returns u the same instance every time u access, which cannot be assumed ...


Originally posted by Nijeesh BH:
Hi,
I have a fundamental doubt in Stateless Session Beans. If i have instance variables in Stateless Session Beans will it behave like a stateful session bean inspite of mentioning session bean type as Stateless in the xml file.
Plz clarify.
Thanks in Advance,
Nijeesh.


Groovy
Nandu Arni
Greenhorn

Joined: Jan 26, 2002
Posts: 8
Why should we use instances variables inside a stateless session bean. If we use, how can we initialize. if you initialize thru create method..it will be a statefull.
Incase of stateless session bean, the connection is set for every method call irrespective of the client accessing the bean.
So it all depends on the vendor implenting the container, conceputually it sould not store the state of the instance variables between the method calls.
but incase if weblogic and websphere, the state of the instance variables defined inside a stateless bean are still maintained.
The idea od SLSB is not to use instance variables.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fundamental doubt in SLB
 
Similar Threads
stateless session bean doubt
doubt
doubt about ejbCreate()
Basic Object Pooling doubt
Session Bean Doubt