bitronix + nonXA connection factory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

bitronix + nonXA connection factory

Viaceslav Pozdniakov
Hi,

We are using BTM as JMS connection pool in standalone application. No XA transactions, only local ones. Not only because of ease of configuration but also because we do not like Jencks. SonicMQ is used as a broker. And here comes the problem: BTM forces us to use XAConnectionFactory implementing Sonic driver class while we need ConnectionFactory (http://documentation.progress.com/output/Sonic/8.0.0/releasedate/Docs8.0/api/sonicmq_api/progress/message/jclient/ConnectionFactory.html) because this kind of driver support load balancing (http://documentation.progress.com/output/Sonic/8.0.0/releasedate/Docs8.0/api/sonicmq_api/progress/message/jclient/xa/XAConnectionFactory.html does not -- throws informing JMSException).

So... is there any way (or workaround) to use not XA but just ConnectionFactory as a target connection factory?

Thanks in advance.  

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: bitronix + nonXA connection factory

Ludovic Orban
Administrator
This is possible while not recommended. See http://docs.codehaus.org/display/BTM/LastResourceCommitJms13
Reply | Threaded
Open this post in threaded view
|

Ats.: bitronix + nonXA connection factory

Viaceslav Pozdniakov
We tried that :)

It fails saying bitronix.tm.resource.jms.lrc.LrcXAConnection can only respond to createXASession()

And that's ok: we are not trying to use nonXA resource as XA. We are trying to use nonXA as nonXA :)
________________________________________
Siuntėjas: Ludovic Orban [[hidden email]]
Išsiųsta: 2010 m. rugpjūčio 13 d. 00:29
Kam: [hidden email]
Tema: Re: [btm-user] bitronix + nonXA connection factory

This is possible while not recommended. See
http://docs.codehaus.org/display/BTM/LastResourceCommitJms13
--
View this message in context: http://old.nabble.com/bitronix-%2B-nonXA-connection-factory-tp29423423p29423453.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Ats.: bitronix + nonXA connection factory

Ludovic Orban
Administrator
I see. Re-reading the code this exception makes sense and this limitation has been introduced to keep the code as simple as possible by only supporting XA access to the LRC connection factory.

You could try patching the code yourself. Try changing LrcXAConnection line 24 with this:

 return new LrcXASession(nonXaConnection.createSession(transacted, acknowledgeMode));

instead of:

 throw new JMSException(LrcXAConnection.class.getName() + " can only respond to createXASession()");

This may or may not work, I'm curious about the result even if I'm reluctant to include this change in the codebase. If it works for you I'll try to find a way to soften the rough edges to get it included.
Reply | Threaded
Open this post in threaded view
|

RE: Ats.: bitronix + nonXA connection factory

Viaceslav Pozdniakov
I tried this solution too by passing the same arguments to nonXaConnection.createSession in createSession() as it is done in createXASession().

I did not investigate the reasons but neither JMS listeners nor producers (we use spring + apache camel) were booted with such patched LrcXAConnection. It deadlocks somewhere or something like that. :/

Viaceslav Pozdniakov | Senior Programmer | [hidden email]
Exigen Services | Ulonu str. 2 | LT-08221 Vilnius, Lithuania
phone +370 5 2059583 | fax +370 5 2754604 |
www.exigenservices.lt

-----Original Message-----
From: Ludovic Orban [mailto:[hidden email]]
Sent: 2010 m. rugpjūčio 13 d. 00:58
To: [hidden email]
Subject: Re: [btm-user] Ats.: bitronix + nonXA connection factory


I see. Re-reading the code this exception makes sense and this limitation has
been introduced to keep the code as simple as possible by only supporting XA
access to the LRC connection factory.

You could try patching the code yourself. Try changing LrcXAConnection line
24 with this:

 return new LrcXASession(nonXaConnection.createSession(transacted,
acknowledgeMode));

instead of:

 throw new JMSException(LrcXAConnection.class.getName() + " can only respond
to createXASession()");

This may or may not work, I'm curious about the result even if I'm reluctant
to include this change in the codebase. If it works for you I'll try to find
a way to soften the rough edges to get it included.

--
View this message in context: http://old.nabble.com/bitronix-%2B-nonXA-connection-factory-tp29423423p29423696.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Ats.: bitronix + nonXA connection factory

Ludovic Orban
Administrator
That's what I was afraid of. Adapting the JMS LRC code to support non-XA usage will certainly require quite some mental work and also lots of testing, especially with SonicMQ which I do not have access to.

I'm sorry but that would require way more time than I can invest at the moment. If you do have time try investigating the problem, you may find it reasonably easy to fix and you can always post here for detailed help.
Reply | Threaded
Open this post in threaded view
|

RE: Ats.: bitronix + nonXA connection factory

Viaceslav Pozdniakov
Thanks!

Viaceslav Pozdniakov | Senior Programmer | [hidden email]
Exigen Services | Ulonu str. 2 | LT-08221 Vilnius, Lithuania
phone +370 5 2059583 | fax +370 5 2754604 |
www.exigenservices.lt


-----Original Message-----
From: Ludovic Orban [mailto:[hidden email]]
Sent: 2010 m. rugpjūčio 13 d. 11:58
To: [hidden email]
Subject: RE: [btm-user] Ats.: bitronix + nonXA connection factory


That's what I was afraid of. Adapting the JMS LRC code to support non-XA
usage will certainly require quite some mental work and also lots of
testing, especially with SonicMQ which I do not have access to.

I'm sorry but that would require way more time than I can invest at the
moment. If you do have time try investigating the problem, you may find it
reasonably easy to fix and you can always post here for detailed help.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email