• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Create session bean stateless and stateful???

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I'm so happy! And I wish to make this tiny ad happy too:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic