EJB stateful vs stateless

By | February 26, 2016

I have been studying Java EE and I posted a question on Stackoverflow to verify my understanding of "SessionBean", here is the summary:

Stateless bean in client:


Stateful bean in client:


  • A stateless session bean, should not store a state in the bean instance, in order words, it's class members should not be assigned by external values.
  • A stateful session bean, maintains it's state until it's "flushed", a bean method that is annotated by "@Remove"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.