Neat. I've been having similar problems trying to execute a findByPrimaryKey
in the ejbCreate method of a bean. Errors, however, just come and go away
randomly.
> -----Original Message-----
> From: Mikael Ståldal [mailto:[EMAIL PROTECTED]]
> Sent: Miércoles, 22 de Agosto de 2001 3:34
> To: Orion-Interest
> Subject: Invoke a method on myself in a Stateful Session Bean.
>
>
> When I try to do like the code below, I get this error:
>
> com.evermind[Orion/1.5.2 (build
> 10460)].server.rmi.OrionRemoteException:
> Recursive call to non-reentrant bean
>
> Is there any other way to do this? I don't want to invoke the methods
> directly, since I want to make use of container managed transactions.
>
>
> /**
> * @ejb:ejb-name Foo
> * @ejb:stateful-session
> */
> public class FooBean extends SessionBean
> {
> private Foo me;
>
> /**
> * @ejb:create-method
> */
> public void ejbCreate()
> {
> me = (Foo)PortableRemoteObject.narrow(
> sessionContext.getEJBObject(),
> Foo.class);
> }
>
>
> /**
> * @ejb:remote-method
> */
> public void foo()
> {
> // do something interesting
> me.bar();
> // do something interesting
> }
>
>
> /**
> * @ejb:remote-method
> */
> public void bar()
> {
> // do something interesting
> }
> }
>