Sateless Beans With Member Variables

Discussions

EJB design: Sateless Beans With Member Variables

  1. Sateless Beans With Member Variables (5 messages)

    Hi,

    I'm declaring a session bean as stateless in deployment descriptor and then also am declaring a member variable for that bean. How the container will treat this bean as? Statefull or Stateless?

    I'm using weblogic 8.1.

    Thanks,
    Jay Khimani
  2. The container will treat as a Staleless bean. The member variable value may be corrupted since it is a staless bean.
  3. ...declaring a session bean as stateless in deployment descriptor and then also am declaring a member variable for that bean...

    I have to ask: why?
  4. Well reason is, i want to store some static variable like logger and some config managers.

    After going through some articles and design contracts of SLSB, I think there should not be any problem as of I'm not maintaining any user specific data.

    Thanks,
    Jay Khimani
  5. Sateless Beans With Member Variables[ Go to top ]

    Well reason is, i want to store some static variable like logger and some config managers. After going through some articles and design contracts of SLSB, I think there should not be any problem as of I'm not maintaining any user specific data.Thanks,Jay Khimani

    store some static variables in Stateless Beans? EJBs were designed to be distributed, how could you manage static variables in several JVMs?
  6. Sateless Beans With Member Variables[ Go to top ]

    Well this is the point which I missed. thanks for this point. static wont work with clusters. For this reason have changed my static member variables to non-static variables.