Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




What do you mean stateful and stateless session bean?

Stateful Session bean:-

  • Stateful session bean maintain the state of the conversation between the client and itself
  • When the client invokes a method on the bean the instance variables of the bean may contain a state but only for the duration of the invocation
  • implements the javax.ejb.SessionBean interface and is deployed with the declarative attribute "stateful"

Stateless session bean:-

  • A stateless session bean is an enterprise bean that provides a stateless service to the client.
  • Conceptually, the business methods on a stateless session bean are similar to procedural applications or static methods; there is no instance state, so all the data needed to execute the method is provided by the method arguments
  • implements the javax.ejb.SessionBean interface and is deployed with the declarative attribute "stateless

See the following video on Factory Pattern in Hibernate: -

Click to get Java Training

Regards,

Get more Java Training from author’s blog

Share this article   |    Print    |    Article read by 4359 times
Author:
Shivprasad Koirala
We conduct training for Java/J2EE technologies like design patterns, J2EE, Struts, Hibernate, Spring, Rich Interface etc. and likes to write articles on the same in free time.
Related Articles: No related article
Related Interview Questions: