Hi,
I got some time today to investigate why the fix i put was failing in
openejb and found that currently since we were passing an XAResource
in org.apache.openejb.core.mdb.EndpointFactory.createEndPoint instead
of a NamedXAResource, the isSameRM(XAResource arg) method check always
returns false as one of the resources will be an XAResource and the
other a NamedXAResource.
This doesn't look correct. The flow never goes inside the if condition.

    public boolean isSameRM(XAResource other) throws XAException {
        if (other instanceof WrapperNamedXAResource) {
            return
xaResource.isSameRM(((WrapperNamedXAResource)other).xaResource);
        }
        return false;
    }
If I pass an instance of WrapperNamedXAResource the flow goes inside
the if and waits in org.apache.activemq.ActiveMQConnection.isSameRM
method.

The wait is because waitForBrokerInfo calls brokerInfoReceived.await()
where brokerInfoReceived is a countdown latch. Once this is waiting it
never gets resumed.

To trigger it the method onCommand(final Object o) has to be called on
org.apache.activemq.ActiveMQConnection. Does anyone have an idea of
when onCommand should be called?

Thanks
Manu

On 9/23/07, Manu George <[EMAIL PROTECTED]> wrote:
> Thanks for catching that.Thats a whopper of an error. It breaks most
> Mdb Tests :(. Will investigate why its breaking  most of the Mdb tests
> and post my findings.
>
> Regards
>
> On 9/23/07, Dain Sundstrom <[EMAIL PROTECTED]> wrote:
> > I had to revert this change since it broke the build.
> >
> > -dain
> >
> > On Sep 22, 2007, at 11:32 AM, [EMAIL PROTECTED] wrote:
> >
> > > Author: manugeorge
> > > Date: Sat Sep 22 11:32:45 2007
> > > New Revision: 578471
> > >
> > > URL: http://svn.apache.org/viewvc?rev=578471&view=rev
> > > Log:
> > > Temporary Fix for GERONIMO-3354 - Exception thrown by MDB involved
> > > in XA transaction.
> > > Wrapped XAResource to make it NamedXAResource. Container id is
> > > passed as the name.
> > >
> > > Modified:
> > >     openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
> > > apache/openejb/core/mdb/EndpointFactory.java
> > >
> > > Modified: openejb/trunk/openejb3/container/openejb-core/src/main/
> > > java/org/apache/openejb/core/mdb/EndpointFactory.java
> > > URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/
> > > openejb-core/src/main/java/org/apache/openejb/core/mdb/
> > > EndpointFactory.java?rev=578471&r1=578470&r2=578471&view=diff
> > > ======================================================================
> > > ========
> > > --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
> > > apache/openejb/core/mdb/EndpointFactory.java (original)
> > > +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
> > > apache/openejb/core/mdb/EndpointFactory.java Sat Sep 22 11:32:45 2007
> > > @@ -17,6 +17,8 @@
> > >   */
> > >  package org.apache.openejb.core.mdb;
> > >
> > > +import org.apache.geronimo.transaction.manager.NamedXAResource;
> > > +import
> > > org.apache.geronimo.transaction.manager.WrapperNamedXAResource;
> > >  import org.apache.openejb.DeploymentInfo;
> > >  import org.apache.openejb.core.CoreDeploymentInfo;
> > >
> > > @@ -54,7 +56,11 @@
> > >      }
> > >
> > >      public MessageEndpoint createEndpoint(XAResource xaResource)
> > > throws UnavailableException {
> > > -        EndpointHandler endpointHandler = new EndpointHandler
> > > (container, deploymentInfo, instanceFactory, xaResource);
> > > +        // Hack to get GERONIMO-3354 error from not ocurring.
> > > +        //TODO Create an abstraction so that we need not use
> > > geronimo api classes(NamedXAResource).
> > > +        //TODO Confirm that this is all that is required for
> > > transaction recovery
> > > +        NamedXAResource wrapper = new WrapperNamedXAResource
> > > (xaResource, container.getContainerID().toString());
> > > +        EndpointHandler endpointHandler = new EndpointHandler
> > > (container, deploymentInfo, instanceFactory, wrapper);
> > >          MessageEndpoint messageEndpoint = (MessageEndpoint)
> > > Proxy.newProxyInstance(classLoader, interfaces, endpointHandler);
> > >          return messageEndpoint;
> > >      }
> > >
> > >
> >
> >
>

Reply via email to