This example shows how to propagate a transaction context between the WildFly and GlassFish application servers. There is a single script to run the full example but you may find it more instructive to run the example in steps perhaps in separate command windows:
./run.sh
or to run each step at a time:
step1.sh
:
- builds GlassFish either from source (using svn) or via prebuilt binaries. The build from source also needs patching using the included patch file (see https://java.net/jira/browse/GLASSFISH-21532 for details);
- builds narayana using the latest version (controlled by the environment variable
NARAYANA_CURRENT_VERSION
) - patches and builds the WildFly version downloaded during the narayana build. The patch disables the interceptor that blocks the importing of foreign transactions. When we have a JIRA to for the issue we will update this README.
step2.sh
: starts WildFly in JTS modestep3.sh
: starts a GlassFish domainstep4.sh
: deploys the test EJB to both servers (for making transactional calls between them)step5.sh
: Make an ejb call from GlassFish to WildFly (using the script inejb_operations.sh
)step6.sh
: Make an ejb call from WildFly to GlassFish (using the script inejb_operations.sh
)step7.sh
: Undeploy EJBs and shutdown GlassFish and WildFly
These steps generate too much output to show in full.
The key output lines to verify that the GlassFish to WildFly transactional EJB call worked is to look for the line:
> ===== JTS interop quickstart: step 5 (EJB call gf -> wf):
followed soon after by a line that includes
> Next: 8000
The number printed will increment on each EJB call.
The key output lines to verify that the WildFly to GlassFish transactional EJB call worked is to look for the line:
> ===== JTS interop quickstart: step 6 (EJB call wf -> gf):
followed soon after by
> Next: 7000
The number printed will increment on each EJB call.