Forums Register Login

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

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
 

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.
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 615 times.
Similar Threads
soft scbcd test questions?
HFEJB: Pg 516, Question# 1
Dependency injection and stateful session beans
Why pool stateless session beans when you can get by with one instance?
Comparing Session and Entity Beans
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:28:49.