• 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

why do u require stateful session bean if no instance variable?

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instance variables are used to store the values between method invocation in the stateful session bean. If there is no variable then what is the use of declaring the bean as stateful?
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read your question as "Why make a session bean stateful if it doesn't maintain any state?" The answer is "Insanity."

Use stateful session beans only when you must maintain state for the client in the bean itself. Many times you can simply pass in the state (which the client maintains) as parameters to a stateless session bean.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David Harkness:
I read your question as "Why make a session bean stateful if it doesn't maintain any state?" The answer is "Insanity."

Use stateful session beans only when you must maintain state for the client in the bean itself. Many times you can simply pass in the state (which the client maintains) as parameters to a stateless session bean.



Hi David,

I just want to make sure that the answer is correct
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic