When we are dealing with stateful session beans we need to store the client conversation
of the bean so that it can be available in client’s next request. But when we talk about
server it has limited resources. If the conversation of the bean is large then the server can
run out of resource. So in order to preserve resources EJB server swaps this conversational
data in memory to hard disk thus allowing memory to be reclaimed. This process of
saving the memory data to hard disk is called as “Passivation”. Now when the client
comes back the conversational data is again swapped from the hard disk to the bean. This
process is called as “Activation”. The container informs the bean that its about to passivate or activate using the "ejbPassivate()" and "ejbActivate()" methods.
of the bean so that it can be available in client’s next request. But when we talk about
server it has limited resources. If the conversation of the bean is large then the server can
run out of resource. So in order to preserve resources EJB server swaps this conversational
data in memory to hard disk thus allowing memory to be reclaimed. This process of
saving the memory data to hard disk is called as “Passivation”. Now when the client
comes back the conversational data is again swapped from the hard disk to the bean. This
process is called as “Activation”. The container informs the bean that its about to passivate or activate using the "ejbPassivate()" and "ejbActivate()" methods.
Can beans who are involved in transaction have “Passivation” process?
No.
No.
How does the server decide which beans to passivate and activate?
Most servers use the (LRU) Last Recently Used time as a strategy. Which mean passivate
the beans which have been called recently.
the beans which have been called recently.
In what format is the conversational data written to the disk?
Bean conversational data is saved in the disk as serialized object. This is possible because
“javax.ejb.EnterpriseBean” implements “java.io.Serializable” interface. So during
passivation time it converts the bean conversational data to a bit-blob and during activationit just reverses the process.
Bean conversational data is saved in the disk as serialized object. This is possible because
“javax.ejb.EnterpriseBean” implements “java.io.Serializable” interface. So during
passivation time it converts the bean conversational data to a bit-blob and during activationit just reverses the process.
No comments:
Post a Comment