jtaManager is the JBoss TransactionManager (arjuna). It's injected, as the class where the above code lives is actually an MBean.
I've made some - limited - progress with this. It appears that the JPAKnowledgeService doesn't like to participate in an existing JTA transaction. By marking the method with @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED), I am able to get a session created within a UserTransaction. The code now looks like this:
UserTransaction txn = retrieveTransaction();
txn.begin();
kSession =
JPAKnowledgeService.newStatefulKnowledgeSession( kBase, null, env );
kSession.getWorkItemManager().registerWorkItemHandler("ValidationService", new ValidationTaskWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("SubscriptionEventUpdateService", new SubscriptionHistoryWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("ImmunizationService", new JMSWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("SchoolFormService", new JMSWorkItemHandler());
kSession.getWorkItemManager().registerWorkItemHandler("LegacySubscriptionService", new JMSWorkItemHandler());
I'm not thrilled about having to deal with UserTransaction, though. Isn't this supposed to support standard managed transactions? Is there something additional I need to provide to the env for it to participate normally?