Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create session bean stateless and stateful???

 
Oelison Sousa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I did not understand because this question is false and true ? they are changed ??

1) The statement is true or false: If a stateless session bean client invokes create() method on the bean's home interface then it is guaranteed that a new stateless session bean instance will be created.

Reply: The statement is false

2) The statement is true or false: If a stateful session bean client invokes create<METHOD>(...) method on the bean's home interface then it is guaranteed that a new stateful session bean instance will be created.

Reply: The statement is true

[ May 12, 2006: Message edited by: Oelison Sousa ]
[ May 12, 2006: Message edited by: Oelison Sousa ]
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answers are right.

Unlike the entity bean and stateful session bean, invoking the create() method for stateless bean does not result in a call to the bean's ejbCreate() method. In stateless session beans, calling the EJB home's create() method results in the creation of an EJB object for the client, but that is all. The ejbCreate() method of a stateless session bean is only invoked once in the life cycle of an instance--when it is transitioning from the Does Not Exist state to the Method-Ready Pool. It isn't reinvoked every time a client requests a remote reference to the bean.

[ UD: removed link to copyrighted material ]


[ May 12, 2006: Message edited by: wise owen ]
[ August 03, 2007: Message edited by: Ulf Dittmer ]
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When you call create() method on Stateless Session Bean, container wont create a new stateless session bean but it assigns an EJBObject to the client. So the answer is FALSE here.

But with Stateful session bean, when you call create method, the container actually creats a bean with the specied values in the create method's signature. So the answer in this case is TRUE.

Hope this helps.

Ugender Rekulampally.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic