views:

325

answers:

2

Hi all,

I'm mantaining a EJB 2 CMP legacy app runing on a JBoss 4.0.4 GA application server with deployed entity/stateless session beans. All the EJB boilerplate code is generated via XDoclet from the EntityEJB/EntityEJBManager annotations.

I've noticed that when my GUI client invokes the facade create method, I have lots of cases of EJBException in my server log with the "Reentrant method call detected" message, which rollbacks the transaction.

What does this Exception means? How can I avoid having such error (which unfortunately, I wasn't able to reproduce yet)


Update: Found this link that explains what is meant by reentrancy, however, seems to me that it says my app cannot be accesed concurrently? Link@JavaRanch

A: 

It does mean that the Entity bean in question cannot be accessed concurrently, which makes sense since it would likely corrupt the data.

Robin
+1  A: 

I've seen this before where EJB1 calls EJB2 which calls back to EJB1 within the container as part of the same transaction.

You can tell the container to allow this by marking EJB1 as reentrant which will allow it to be accessed multiple times in the same transaction.

This is done in the deployment descriptor with the following tag:

<reentrant>True</reentrant>

There should be a corresponding EntityEJB annotation that XDoclet can use to generate this for you.