• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fundamental doubt in SLB

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic