I have a asynchronous command processor module that spins off a number of background threads that reads DB records, loads one command (CDI Bean) per record and runs the command. Arquillian tests with Weld-SE container works fine. However, when I put this in a JavaEE environment (as a JBoss Module in JBoss EAP 6.1.1) the @Transactional annotation does not take effect - the background method runs without a transaction. Hence the changes to entities never makes to the DB.
The client module that depends on this messaging module, has this in the bean.xml
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:t="urn:java:org.jboss.seam.transaction"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<interceptors>
<class>org.jboss.seam.transaction.TransactionInterceptor</class>
</interceptors>
</beans>
I tried the trick mentioned in Seam @Transactional annotation not working? but that did not work.
Any idea why this is the case?