• Post Reply Bookmark Topic Watch Topic
  • New Topic

problems with reentrancy

 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I'm trying to write a CMP entity bean with such method:



When I run it I get the following exception:


"javax.ejb.EJBException: Reentrant method call detected: MyBean 64"


I am using XDoclet and when I add reentrant="true" to the @ejb.bean tag everything starts to work.

But I guess it can cause problems since I'm not really sure what reentrant means. I would be grateful for any links to fool-proof info about this "reentrancy" or if any1 could explain me why this method causes such problems/and how to avoid them I would be also very grateful.

Kind Regards,

Karol Oslowski
 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here I found a lot of information about reentrancy. So now I would be grateful if someone could explain me why this method causes such problems because for me it shouldn't since the code is equivalent to simply calling a getter from a business method...
 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What confuses me is that when I exchanged the line



with:



the code is no more reentrant and as far as I understand it it is exactly equivalent.

Thx. again for any advice,

Regards,

Karol Oslowski
 
Sajid Moinuddin
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you have understood the reentrancy point from your link
Client --> EJB A --> EJB B --> EJB A

what you are doing is
Client --> EJB A --> EJB A

Container detects reentrant call to EJB A.(It doesn't know if EJB A/ EJB B is making the call)

If you really want to do something like this,
set ther "reentrant" property of you bean to "true" in the ejb-jar.xml

hope it helps,
Regards.
Sajid
 
Karol Oslowski
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your answer. I was suspecting something like this. I need this code to call a method by it's name so probably I'll leave this like that.

Thank you again,

Karol Oslowski
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!