0

We are deploying app to WildFly 8.0.0.Final. The app used to run on Jboss EAP 6.0/AS7.1 fine with Seam3 managing JTA transaction.

However, since Seam3 does not work with WildFly, we are replacing it with DeltaSpike. We deployed the core and jpa module. However, it does not seem it works with mysql XA datasource well, even we tried hard to follow the instruction on their website and added apache-deltaspike.properties file to enable JTA support. When there are more than one datasource is involved, we see transaction errors. By turning on trace level logging for org.jboss.jca, we see warnings such as cannot list another datasource form current one and the jdbc driver failed.

The other problem we saw is that the @Transactional requires a presence of EntityManager. But sometimes, we have to look up an entitymanager at runtime instead of injecting one. In this case, we would get NullPointerException. We would have to inject an entitymanager even we do not need it just to make @Transactional not throw NPE.

Tomaz Cerar
  • 5,761
  • 25
  • 32
user3243153
  • 45
  • 2
  • 8
  • What is the exception? Why do you need XA datasource? you have more than one database/transactional resource that participates in transaction? – Tomaz Cerar Mar 04 '14 at 14:24
  • Yes, we do have more than one datasources involved in a transaction and that is working fine in seam3 transaction module. The reason is that we have to pick a datasource dynamically but in mysql datasource config, we config the datasource by server instance as there are too many datasources on one server instance. So the query/update always lands on one known datasource and then use schema prefix in the jpa native query (update). – user3243153 Mar 04 '14 at 15:51
  • I don't know it is the Wildfly JCA or the Deltaspike's jpa transaction interceptor which is broken on the jta. According to Deltaspike JTA is suppoprted and we follow the instruction. But after days of tries, it did not work. It worked with single datasource. – user3243153 Mar 04 '14 at 15:56
  • For the NPE in Deltaspike, we have to inject a EntityManager even we do not always need em. Some methods of the code just does not need transaction (for example the code update a file), but the Deltaspike throw NPE. It is annoying and I really wish Seam3 transaction worked in Wildfly. – user3243153 Mar 04 '14 at 16:00
  • The npe is as follows:java.lang.NullPointerException at org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy.beforeProceed(BeanManagedUserTransactionStrategy.java:119) [deltaspike-jpa-module-impl-0.5.jar:0.5] I think there should be a null check for the Entitymanager in the code, If there is no Entitymanager just not to start transaction – user3243153 Mar 04 '14 at 16:02
  • You should try with deltaspike 0.6 that works much better with WildFly 8 – Tomaz Cerar Apr 10 '14 at 22:28

0 Answers0