What is "reentrant"? Why we use this in the deployment descriptor? Explain with an example.

Showing Answers 1 - 6 of 6 Answers

sennee

  • Jan 29th, 2007
 

The term reentrant is the word you can find in Deployment Descriptors. when a bean is executing a client request in a given tranaction context and another request with the same transaction context arrives for the same entity bean, then what should the container do with second request? The Non-reentrant and reentrant instances are best explained in the ejb specification. Refer to Section 10.5.11 in EJB 2.0 specification.

  Was this answer useful?  Yes

The "reentrant " element dictates whether our bean can call itself through another bean.For exmple, take two beans are there in EJB container named "beanA" and "beanB".There is an element " True " in the ejb-jar.xml , deployment descriptor.If it has been set to True, If beanA calls beanB, in turn it (beanB) calls back beanA. this loop back call is possible.If it has been set to False, the above said case is not possible.This is special case of multi threading because it is only one path of execution that happens to loop back on itself.If we would like to support this " reentrant " behaviour, we should set this setting to True, so thatContainer will allow two threads to run inside of a beanA at once.If we wont that behaviour , we should set it to "False" .with regards,santh

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions