0 Replies Latest reply on Jan 14, 2009 6:38 PM by Dean Hiller

    definition of a stateless bean is what?

    Dean Hiller Expert

      Let me give some important background before you answer that.  I used to have beans that had NO private fields and looked up data from the sessoin IN the method.  This allowed me to have multiple sessions(meaning multiple threads) call into the SAME instance of my bean. 
         Now with seam, the model has changed where I can have that stuff injected into my bean, BUT doesn't this make my bean stateful now???  Now I canNOT have multiple threads using the same instance of my bean.  In fact, nearly every bean is now stateful????


      Is this true?  ie. any time I inject a bean from application state, session state or conversation state into bean X, then bean X then is now stateful since it cannot be used while in use by that session?


      Another definition of course is that I am stateless if once my action method is done being called, I have not kept any state I need to keep and can be reused by another session which I am guessing is the model here.  It is not truly stateless in the first definition above at the top where I can have multiple threads in at the same time, but is more this switching between stateful and stateless states kind of entity....almost semi-stateful or stateful at times.


      Comments, thoughts, corrections are welcome!!!
      thanks,
      Dean