Hi,
I've got a MDB basically layed out as the following (as7 build from a couple of days ago):
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination", propertyValue="queue/A"),
@ActivationConfigProperty(propertyName="messageSelector", propertyValue="source = 'IDA' AND type='Edit'")
})
@TransactionManagement(TransactionManagementType.BEAN)
public class SomeMDB implements MessageListener {
@Inject
private Logger log;
@PersistenceContext
private EntityManager em;
@Resource
private EJBContext ctx;
public void onMessage(Message msg) {
try {
final UserTransaction tx = ctx.getUserTransaction(); // <-- Error here
Session session = (Session)em.getDelegate();
tx.begin();
// do stuff
tx.commit();
} catch (Exception ex) {
log.error(ex);
}
}
}
I get this error when run: javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - thread is already associated with a transaction!
Is this a bug, not implemented, or something I've overlooked? It works fine in previous versions of JBoss.
Regards
Kjell
I have the same error with Wildfly 8.0.0 and am currently searching for a solution.
Although in my case, the exception gets thrown on UserTransaction.begin().