Hi,

No, the TxInterceptorCMT.invokeNext in line 133 is purely local,
as all interceptor chain stuff. It simply calls the next
interceptor in the chain. In this interceptor chain configuration
that is the EntityInstanceInterceptor.

But from within your bean code, you do a remote call to yourself.
You cannot do that unless you declare your bean reentrant, which
I would not recommend. Problem is that the container has no way
of knowing if this is a loopback call (legal) or a concurrent
call (not legal). See the EJB spec.

It is probably best to redesign to avoid reentrant calls.
You could do this by letting your client call bean.getOrt()
and pass this as the argument to your changeMyOrt() method.
Alternatively, move this functionality to a stateless session
bean.


Best Regards,

Ole Husgaard.


Lutz Hilken wrote:
> 
> Hi,
> 
> when calling a Bean (CMP) and passing a reference to itself, a call to a
> property getter results in an endless loop in the transaction interceptor.
> See the following:
> 
> Client calls:
> 
>    bean.changeMyOrt (bean);
> 
> Beans method is:
> 
>    public void changeMyOrt (MyBean l) throws RemoteException
>    {
>       System.out.println ("Setting Ort: " + ort);
>       System.out.println ("to new Ort: " + l.getOrt ());
>       setOrt (l.getOrt ());
>       System.out.println ("Setting Ort..done: " + ort);
>    }
> 
> The server loops endless wihtin this thread:
> 
>         at
> org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce
> ptor.java:225)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
> java:307)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
>         at
> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
> 8)
>         at
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
>         at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:349)
>         at
> org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
> nvoker.java:483)
>         at
> org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericPr
> oxy.java:335)
>         at
> org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:13
> 3)
>         at $Proxy73.getOrt(Unknown Source)
>         at
> de.ivu.probued.lutzmodel.ejb.LutzBean.changeMyOrt(LutzBean.java:81)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
> org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.ja
> va:848)
>         at
> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchron
> izationInterceptor.java:279)
>         at
> org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce
> ptor.java:256)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
> java:307)
>         at
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
>         at
> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12
> 8)
>         at
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
>         at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:349)
>         at
> org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
> nvoker.java:393)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
>         at sun.rmi.transport.Transport$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at sun.rmi.transport.Transport.serviceCall(Unknown Source)
>         at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
> 
> It seems to be the line 133 in TxInterceptorCMT.invokeNext that causes the
> loop. There, the subsequent call to the bean is done in remote mode. Is this
> nessesary? Or is something wrong with my code?
> 
> Thanks for help!
> 
> Lutz.
> 
> Lutz Hilken
> IT-Consult
> IVU Traffic Technologies AG
> Bundesallee 88, D-12161 Berlin
> Telefon: +49.30.85 906-450, Telefax: +49.30.85 906-499
> [EMAIL PROTECTED], www.ivu.de
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to