Just by seeing the signature of the bean how can you specify whether it is a Stateful or Stateless Session Bean?

Showing Answers 1 - 5 of 5 Answers

sindhu27

  • Nov 23rd, 2005
 

For a stateful session bean method signature would include some arguments where as for a stateless session bean the method signature is without any parameters.ie no state would be associated with the client.

  Was this answer useful?  Yes

shiv shankar

  • Nov 24th, 2005
 

For a stateful session bean in the home interface the create(..)method signature will have some arguments where as for a stateless session bean the create() method of the home interface will have no arguments.ie no state would be associated with the client.

  Was this answer useful?  Yes

Bipin Jethwani

  • Jan 28th, 2006
 

The create method in a stateless session bean cannot have arguments, and can only have a single method called create(). While create in Stateful bean can have arguments and could be any method starting with create string eg. create<method>(arg1, arg2,...). Although it is not compiler checked but in stateless bean the ejbPassivate() and ejbActivate() methods has to be empty as these functions are never called by EJB container. As conceptually in stateful session bean we might need to store the clients information hence arguments in create<method> are necessary. While in stateless bean we don't, hence no arguments are necessary. It's intutive isn't. I my life I haven't seen such a futuristic server programming tool as EJB.

  Was this answer useful?  Yes

u can just check the home interface of the session bean in order to detemine the whether it is stateless or stateful.

if there is single create method in home interface with no argument then we can say it is stateless session beans whereas in stateful session bean we can have diffrerent versions of create method in order to have initial state according to client.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions