Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Each Entity Bean may however be shared by multiple EJB Clients.

 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each Entity Bean may however be shared by multiple EJB Clients.
How this concept being implemented in EJB ?
What is instance pooling in EJB ? How does server help to do it?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Each Entity Bean may however be shared by multiple EJB Clients.
How this concept being implemented in EJB ?


Each client performs its operations in a transaction, which isolates the clients' operations from each other.

What is instance pooling in EJB ? How does server help to do it?


The lifecycle of EJBs described in the EJB 2.0 specification explains the pooling pretty well. Here's the short version, however:
For stateless session beans, the EJB Container can keep a pool of "free" instances of the EJBObject/implementation class. When an invocation is received for that particular session bean, one of the free instances is picked from the pool, the method invocation is delegated to it, and the bean is returned into the free pool.
Entity beans are pooled a bit differently. The container keeps a pool of free instances who don't have any identity associated at that time. Once the client requests a reference to a particular entity (identified with a primary key), the container picks one instance from the pool, assigns it the identity (primary key), loads the data into the instance, and lets it handle the client's requests. When the container figures out that the bean is no longer being used, it returns it removes the identity and puts it back into the free pool.
 
reply
    Bookmark Topic Watch Topic
  • New Topic