Hi,

I found a problem: Each time a bean method throws a business exception, I'm
unable to commit or rollback the transaction initiated by the client ( but
it 's rolled back later by the jonas TM's timeout). I mean that the rollback
method is called on the UserTransaction object but the rollback isn't
propagated to the jonas server.

I looked at the source code to understand what's going wrong. And I found
that in the org.objectweb.jonas.rmifilters.RemoteStub class the
propagationContext is not well handled.

public class RemoteStub extends java.rmi.server.RemoteStub {
......
    public void invoke(java.rmi.server.RemoteCall call)
        throws java.lang.Exception, java.rmi.MarshalException {
....
        // Add it to output args
        try {
            ObjectOutput out = call.getOutputStream();
            out.writeObject(pctx);
        } catch (IOException e) {
            throw new MarshalException("error marshalling propagation context", e);
        }

// >>>>>>>>>>>>>> Problem seems to be here
        // Invoke remote method call
                ref.invoke(call);
// >>>>>>>>>>>>>>

        // Extracts PropagationContext from input args
        try {
            ObjectInput in = call.getInputStream();
            pctx = (PropagationContext) in.readObject();
        } catch (IOException e) {
            throw new UnmarshalException("error unmarshalling propagation context",
e);
        }

....
    }
.....
}


Indeed the exception thrown by the bean method prevents the interposition
class from reifying the exception and returning the right
"PropagationContext" to the client.


I have designed a solution that makes the interposition class handle the
business exception. It inserts it into the PropagationContext object. The
RemoteStub class manages it and reifies it to a client exception. So, the
PropagationContext is ok and the client is able to commit or rollback its
transaction.

I have done changes to the 2.2.6 source code. I enclose the modified files.
You can locate changes with the //TGU comments I inserted.



--------------------------------
Thomas GUIU
LIBeLIS, Liberty for Large IS
Ing�nieur Consultant
























----
This list is cross-posted to two mail lists.  To unsubscribe,
follow the instructions below for the list you subscribed to.
For objectweb.org: send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe ejb-container-group".
For enhydra.org: send email to [EMAIL PROTECTED] and include
in the body of the message "unsubscribe ejb-container-group".

Reply via email to