0

I have a Java based web application. I am using Spring Integration to integrate with Database (Jpa Outbound Adapter) and Tibco EMS (JMS outbound adapter). However, now I need to put some code where the same message needs to be 1. persisted in database and 2. sent over JMS.

The issue is these activities (1 and 2) need to happen in a transaction. Either both happens or none. I am trying to achieve this with Bitronix. However as of now I have not been able to get it done. I am getting errors which in plain english means (pardon my translation here) "we can not achieve transaction outside XA transaction.

Has anyone tried this before. Any help will be appreciated.

Thanks,

partha
  • 2,286
  • 5
  • 27
  • 37

2 Answers2

0

I am not familiar with Bitronix but have seen jotm and Atomikos used successfully.

However, you may wish to explore alternatives to using XA, as discussed in this article...

http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
0

I am notsure what is your configuration to setup bitronix if you share sample code of configuration that will help much to understand the problem.

As far as your question concerns, Looks like bitronix is not set up correctly. you should go through below link to verify or set up bitronix configuration.

https://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/TomcatWithBtm2x.adoc

one more thing, if you configure bitronix through jndi than make sure to exclude all the transaction related jar from your maven build and put transaction and bitronix related jars on lib folder.

bvyas
  • 384
  • 3
  • 10