Forums Register Login

Entity Bean Passiavtion?

+Pie Number of slices to send: Send
CAN The container choose to passivate an entity bean instance WITHIN a transaction, or BETWEEN transaction, or BETWEEN METHODS. How the container decide when to passivate?
+Pie Number of slices to send: Send
The container will not passivate entity beans or stateful session beans if they are in a transaction. It could passivate an entity bean in between transactions because this is the same as saying, "not in a transaction." It could passivate an entity bean between methods. In this case, when another client goes to use the same entity, the container will just bring another bean out of the pool to represent the entity. Different containers will have different passivation logic. It is not for you, the bean developer to worry about. One reason a container might passivate an entity bean is that it is running low on resources and no one has called a method on the bean in a while.
[ March 01, 2004: Message edited by: Anthony Watson ]
+Pie Number of slices to send: Send
The container cannot passivate an entity bean instance WITHIN a transaction.
But it can passivate BETWEEN transaction, or BETWEEN METHODS.
+Pie Number of slices to send: Send
 

The container will not passivate entity beans ... if they are in a transaction.


I used to think this was true, until I read a surprising passage in the spec [section 10.5.1, pg 169]:


The container can chose to passivate an entity bean within a transaction.


This may seem odd, but when you think about it, this can work for an entity bean. The container can do an ejbStore without doing a commit; the data is just hanging around on the server waiting for the commit at the end of the transaction, so the entity bean instance really isn't needed any longer.
+Pie Number of slices to send: Send
As Reid said,
SFSB cannot be passivated in a transaction.
Entity beans can be passivated in a transaction by the container.
The concept of passivation is different for SFSB and Entity bean, even though they both share the same name.
Passivation of SFSB deals with the serialization of the bean's data,
while passivation of entity beans deals with the bean being sent back to the pool.
+Pie Number of slices to send: Send
If an entity bean is in the middle of a transaction why would the container want to passivate? How would that effect the transaction? I mean we are talking CMT here so it must be in the middle of a method and therefore doing something currently (or uber-badly programmed). It sort of worries me that mid way through changing a field on an entity the container just throws it back to the pool. What happens to the transaction? Does the pooled entity bean retain its lock on the database row?
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 894 times.
Similar Threads
Entity bean - passivated in a TX !
Confirmation About Transaction
If the bean doesn't meet the requirements for passivation.
passivation difference entity and session beans
Queries on Entity Beans
More...

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