Bugs item #516953, was opened at 2002-02-13 05:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516953&group_id=22866

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Harris (charris)
Assigned to: Nobody/Anonymous (nobody)
Summary: setRollbackOnly() in sfsb behaviour

Initial Comment:
JBoss 2.4.3, JDK1.3.1 on Win2000.

The attached file contains a simple sfsb with a single 
method that calls EJBContext.setRollbackOnly(). Two 
consecutive calls to this method from an ordinary java 
client result in the following exception propagated 
back to the client:

=========================
java.rmi.ServerException: RemoteException occurred in 
server thread; nested exception is: 
        javax.transaction.TransactionRolledbackExceptio
n: Application Error: no concurrent calls on stateful 
beans; nested exception is: 
        java.rmi.RemoteException: Application Error: 
no concurrent calls on stateful beans

javax.transaction.TransactionRolledbackException: 
Application Error: no concurrent calls on stateful 
beans; nested exception is: 
        java.rmi.RemoteException: Application Error: 
no concurrent calls on stateful beans

java.rmi.RemoteException: Application Error: no 
concurrent calls on stateful beans

        at 
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFro
mServer(StreamRemoteCall.java:245)

        at 
sun.rmi.transport.StreamRemoteCall.executeCall
(StreamRemoteCall.java:220)

        at sun.rmi.server.UnicastRef.invoke
(UnicastRef.java:122)

        at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_
Stub.invoke(Unknown Source)

        at 
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invo
keContainer(GenericProxy.java:357)

        at 
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionPr
oxy.invoke(StatefulSessionProxy.java:136)

        at $Proxy1.error(Unknown Source)

        at 
com.lombardrisk.trading.test.StatefulTestBeanTest.main
(StatefulTestBeanTest.java:24)

==================================
On the server, this exception is preceded by:

===================================
[StatefulSessionEnterpriseContext] locked < 0
java.lang.Throwable
        at org.jboss.ejb.EnterpriseContext.unlock
(EnterpriseContext.java:170)
        at 
org.jboss.ejb.plugins.StatefulSessionInstanceIntercepto
r$InstanceSynchronization.afterCom
pletion(StatefulSessionInstanceInterceptor.java:410)
        at tyrex.tm.impl.TransactionImpl.forget
(TransactionImpl.java:2009)
        at tyrex.tm.impl.TransactionImpl.rollback
(TransactionImpl.java:541)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:352)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:99)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:195)
        at 
org.jboss.ejb.StatefulSessionContainer.invoke
(StatefulSessionContainer.java:341)
        at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.
invoke(JRMPContainerInvoker.java:3
95)
        at java.lang.reflect.Method.invoke(Native 
Method)
        at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:241)
        at sun.rmi.transport.Transport$1.run
(Transport.java:152)
        at java.security.AccessController.doPrivileged
(Native Method)
        at sun.rmi.transport.Transport.serviceCall
(Transport.java:148)
        at 
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:465)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.ru
n(TCPTransport.java:706)
        at java.lang.Thread.run(Thread.java:484)
[StatefulSessionEnterpriseContext] locked < 0
java.lang.Throwable
        at org.jboss.ejb.EnterpriseContext.unlock
(EnterpriseContext.java:170)
        at 
org.jboss.ejb.plugins.StatefulSessionInstanceIntercepto
r$InstanceSynchronization.afterCom
pletion(StatefulSessionInstanceInterceptor.java:410)
        at tyrex.tm.impl.TransactionImpl.forget
(TransactionImpl.java:2009)
        at tyrex.tm.impl.TransactionImpl.rollback
(TransactionImpl.java:541)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:352)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:99)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:195)
        at 
org.jboss.ejb.StatefulSessionContainer.invoke
(StatefulSessionContainer.java:341)
        at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.
invoke(JRMPContainerInvoker.java:3
95)
        at java.lang.reflect.Method.invoke(Native 
Method)
        at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:241)
        at sun.rmi.transport.Transport$1.run
(Transport.java:152)
        at java.security.AccessController.doPrivileged
(Native Method)
        at sun.rmi.transport.Transport.serviceCall
(Transport.java:148)
        at 
sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:465)
        at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.ru
n(TCPTransport.java:706)
        at java.lang.Thread.run(Thread.java:484)
======================================

To me, this is wrong. Calling setRollbackOnly() (and 
not throwing a system exception in the remote method) 
should simply roll back the transaction - the sfsb 
should be available for further use. Yet it seems that 
the sfsb is not being unlocked properly if no 
exception is thrown. I suspect the problem may lie in 
the locking code of EnterpriseContext.java but don't 
have the expertise to suggest a patch.

If an application exception is thrown from the bean 
method instead of just returning a value (e.g. throw a 
NumberFormatException after the call to 
setRollbackOnly) subsequent calls produce a 
serialisation error indicating that the bean instance 
has been destroyed. Again, I don't think this should 
happen since this behaviour should only occur after a 
system exception is thrown (ejb 2.0 spec $18.4.1, ejb 
1.1 spec 12.4.1).

Behaviour if throwing a system exception is as 
expected.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516953&group_id=22866

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

Reply via email to