Posts

Showing posts from February, 2019

Spring JMS and JPA XA Transactions with WebLogic

spring-jms-and-jpa-xa-transactions-with-weblogicThis article shows the configuration of using XA transactions with the resources managed by WebLogic server.There are three parts of configurations for this XA transactions to work - JMS, JPA and JTA. Both JMS and JPA are acquired through the JNDI registry and the XA transaction manager implementation uses the one from the WebLogic server. This configuration relies on WebLogic server. The concept should be similar and applicable to other JEE application servers. With these configurations, we could easily use @Transactional annotation on the services for XA transactions.JmsConfiguration.java Excerpt@ConfigurationpublicclassJmsConfiguration{// properties...@Beanpublic ConnectionFactory connectionFactory(){returnlookupByJndiTemplate(jmsConnectionFactory, ConnectionFactory.class);}@Beanpublic JndiTemplate jndiTemplate(){ JndiTemplate jndiTemplate =newJndiTemplate(); jndiTemplate.setEnvironment(getJndiProperties());return jndi…