How to propagate transactions via SCA binding in SwitchYard
Issue
-
We have two services
Hello
andWorld
. WhenHello
uses theUserTransaction
and callsWorld
before doing commit, an error occurs.@Service(HelloService.class) public class HelloServiceBean implements HelloService { @Reference @Inject private WorldService worldService; @Inject private UserTransaction utx; @Override public void doTest() { try { utx.begin(); worldService.doTest(); utx.commit(); } catch (Exception e) { try { if (utx.getStatus() == Status.STATUS_ACTIVE || utx.getStatus() == Status.STATUS_MARKED_ROLLBACK) { utx.rollback(); } } catch (Exception e1) { e1.printStackTrace(); } } } }
-
We do not want to suspend the current transaction and we are invoking the service via SCA.
- How can we propagate the transaction to the invoked service?
Environment
- Red Hat JBoss Fuse Service Works (FSW)
- 6.0
- Red Hat JBoss Fuse
- 6.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.