If this is an interview question, ....

jabber (jabber)
Don't try to to recite definitions. A SessionBean has some methods.
If this call of a method does not leave any information for next call, it is stateless.
If this call accumulates some information for next call, it is stateful.

It is your business that decides whether to be stateful or not. For instance, if you need a SessionBean called TaxCalculatorBean, I
would like to suggest deploying it as stateless. Why? For each method call, we just need input some parameters such as quantity, states(provinces) and get a tax to be charged. The present calculation have nothing to do with next one.

I have not used EJB for some time. I remember that if one wishes to make stateless SessionBean, he needs to declare no instance variables.

"Stateless" is a word we needs to pay attention. As I was a beginner, I asked several professional programmers but they gave me wrong explanations. Maybe because we are not native-English speakers.
2000-11-30 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: I am a new comer who first enter into this forum. Now I am doing a project using Java and EJB. I want to ask Jabber a question about EJB and say thanks first.

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论