aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question about Reentrant Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "Question about Reentrant" Watch "Question about Reentrant" New topic
Author

Question about Reentrant

B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
The mock exam in HFEJB for the MDB chapter says :

The container should treat MDB instances as non-reentrant.

I somehow got this question right by eliminating the other 3 options
Can someone tell me what does non-reentrant mean?

Also in an entity bean's DD, we have <reentrant>False</reentrant>. What does this mean? Is this covered in the exam?

Thanks
Ramakrishnan Viswanathan
Ranch Hand

Joined: Aug 24, 2005
Posts: 90
A generic description of reentrancy would be like this:
For any two beans A and B, if you call B's method from A, and subsequently try to call A's method from B, and the call goes through fine, then A is said to be reentrant.

From sec 10.5.11 of EJB 2.0 Spec:
An entity Bean Provider can specify that an entity bean is non-reentrant. If an instance of a non-reentrant entity bean executes a client request in a given transaction context, and another request with the same transaction context arrives for the same entity object, the container will throw an exception to the second request. This rule allows the Bean Provider to program the entity bean as single-threaded, non-reentrant code.

The functionality of entity beans with container-managed persistence may require loopbacks in the same transaction context. An example of a loopback is when the client calls entity object A, A calls entity object B, and B calls back A in the same transaction context. The entity bean�s method invoked by the loopback shares the current execution context (which includes the transaction and security contexts) with the Bean�s method invoked by the client.


Regards<br />Ram<br /> <br />SCJP 1.4, SCBCD 1.3, (SCEA)
Ramakrishnan Viswanathan
Ranch Hand

Joined: Aug 24, 2005
Posts: 90
When you call bean B's method from bean A, and if bean B tries to call bean A's method again (called a loopback) in the same txn context, then the container will not be able to distinguish such a call from a concurrent access call within a single txn. Setting <reentrant> to True will permit such an operation.
Ramakrishnan Viswanathan
Ranch Hand

Joined: Aug 24, 2005
Posts: 90
Some more threads in this forum pertaining to this topic.

Stateful sessionbean - Re-Entrant property clarification

reentrant???
B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
Got it
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Question about Reentrant
 
Similar Threads
Reentrancy
reentrant tag
reentrant???
[SCBCD 1.3] re-entrant DD
reentrant