2008/7/18 Ryan Stewart <[EMAIL PROTECTED]>:
>
>
> James.Strachan wrote:
>>
>> Sure - though when using JDBC and JMS together you need to use JTA and
>> XA. While ActiveMQ can support Oracle as a persistence option, on the
>> ActiveMQ broker - it cannot currently take part in a JDBC-only
>> persistence transaction on the JMS client side. Currently the broker
>> side use of JDBC persistence is a separate transaction.
>>
>> To use JTA / XA just create a Spring JTA transaction manager and
>> register it with the JDBC and JMS components.
>>
>
> Yes, this is what I'm trying to figure a way through. I don't want to use
> XA. All of the database work is coming from the same box and going to the
> same database. I'd like to use the same DB connection to do some of my own
> work and then store the broker's persistence data so that it can be enclosed
> in a local transaction. I see that the transaction is managed internally, so
> I was thinking of handing ActiveMQ a proxied java.sql.Connection object that
> will intercept the commit call and make sure that all of the combined work
> is committed properly.

Thats currently not possible with ActiveMQ I'm afraid.

The easiest thing is to store messages as entity beans in some table;
then get the ActiveMQ broker to bridge from the table to some queue in
a separate process.

e.g.

<route>
  <from uri="jpa:com.acme.MyMessageEntity"/>
  <to uri="activemq:SomeQueue"/>
</route>

Then you can use hibernate or whatever in your application to send
messages without using XA.

BTW you can also use a CamelDestination with the ActiveMQ JMS API; so
your JMS code can send to, say, new
CamelQueueDestination("jpa:com.acme.MyMessageEntity"/> to achieve the
same thing but fooling your JMS code into thinking you're doing a pure
JMS call when really just using JPA

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to