Dear All,
I have the following two session beans -
1. CountBean(Session Bean), CountObject(EJB Object) and CountHome(EJB Home)
2. LocalBean(Session Bean), LocalObject(EJB Local Object) and LocalHome(EJB Local Home)
In one of the CountBean's business method, I got the local object(LocalObject) as -
InitialContext ctx = new InitialContext();
LocalHome localHome = (LocalHome)ctx.lookup("java:comp/env/ejb/Local");
LocalObject localObject = localHome.create();
And, then got a reference of the remote object(of CountObject) as -
EJBObject eO = mySessionCtx.getEJBObject();
Finally, I called the business method(passing the above mentioned remote object "eO") of LocalBean as follows -
localObject.passCountObject(eO);
In the LocalBean, I have the following code snippet -
public void passCountObject(EJBObject eO) {
((CountObject)eO).toTest();
}
I get an exception at ((CountObject)eO).toTest(); as -
SystemErr R java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.container.BeanNotReentrantException: TX_IN_METHOD
What can be the reason for the same?
Thanks in advance.
Regards,
Ashish A.
Discussions
EJB programming & troubleshooting: NotReentrantException in calling one bean's method from another.
-
NotReentrantException in calling one bean's method from another. (3 messages)
- Posted by: Anunay Ashish
- Posted on: July 27 2005 23:31 EDT
Threaded Messages (3)
- NotReentrantException in calling one bean's method from another. by Rakesh Malpani on July 28 2005 14:04 EDT
- NotReentrantException in calling one bean's method from another. by Viktor Sadovnikov on August 01 2005 04:08 EDT
- NotReentrantException in calling one bean's method from another. by Viktor Sadovnikov on August 01 2005 04:27 EDT
-
NotReentrantException in calling one bean's method from another.[ Go to top ]
- Posted by: Rakesh Malpani
- Posted on: July 28 2005 14:04 EDT
- in response to Anunay Ashish
You cannot recurse in EJB's.. -
NotReentrantException in calling one bean's method from another.[ Go to top ]
- Posted by: Viktor Sadovnikov
- Posted on: August 01 2005 04:08 EDT
- in response to Anunay Ashish
What are transaction attributes of LocalBean#passCountObject() and CountBean#toTest()??
Your CountBean EJB is in transaction (the business method), therefore it can not participate in another one. That's normally a reason for BeanNotReentrantException -
NotReentrantException in calling one bean's method from another.[ Go to top ]
- Posted by: Viktor Sadovnikov
- Posted on: August 01 2005 04:27 EDT
- in response to Viktor Sadovnikov
The second thought: I'm not sure that result of mySessionCtx.getEJBObject()is meant to be passed over the bean's "borders". You can freely use it the POJO's calls