• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

The difference between EJB object and stateless session beans

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am new to Enterprise java beans. I am reading "Enterprise JavaBeans 3.1" Oreilly book to learn. I am stuck at a place where I am not able to understand what the author mean to say regarding Stateless and Stateful session beans. The statement is

Stateless session beans
"Once an instance is in the Method-Ready Pool, it is ready to service client requests. When a client invokes a business method on an EJB object, the method call is delegated to any available instance in the Method-Ready Pool. While the instance is executing the request, it is unavailable for use by other EJB objects. Once the instance has finished, it is immediately available to any EJB object that needs it. Stateless session instances are dedicated to an EJB object only for the duration of a single method call."

Stateful session beans
"Each SFSB is dedicated to one client for the life of the bean instance; it acts on behalf of that client as its agent. Stateful session beans are not swapped among EJB objects, nor are they kept in an instance pool like their stateless session counterparts. Once a stateful session bean is instantiated and assigned to an EJB object, it is dedicated to that EJB object for its entire lifecycle."

I am not able to understand
What the term EJB object mean?
What is difference between EJB object and Stateless session instance or Stateful session instance?

Thanks
Sumanth
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From their terminology the EJB object is something that the client has and that the client makes the EJB call on so it's just a reference to the EJB, typically of the EJB's interface type.

 
Greenhorn
Posts: 27
Hibernate jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem with beginners is they start to learn with the EJB3.1v it's the abstraction level of older EJB older version so it is hard to learn by themselves, because most the books are written for one has previous knowledge of older version of EJB. your questions which are basics of the EJB, so if i give answer here, once again it seems for you like iron peanuts.... so for beginners should have the good resource to learn the EJB. to i recommend you to go through the this article A beginner's guide to EJB and i recommend to refer the EJB 3 in action book, there are minimal differences b/w EJB 3 and EJB 3.1, once you comfortable with EJB 3 you can easily switch to EJB 3.1 in matter of time..
 
Sumanth Prabhakar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys for the reply. Now I understood the term EJB object.
 
reply
    Bookmark Topic Watch Topic
  • New Topic