0

Im writing an inbound resource adapter with JCA for a legacy EIS.

The EIS does not support XA transactions. The messages however form a conversation that exist of multiple messages. Each message leads to an action that will be executed by the message endpoint.

At the end of the conversation, a commit/rollback message will be received. At that moment all actions should be either committed or rolled back.

Is there any way that I can manage the lifecycle myself from within the RA?

  • Note that the current solution used a stateful session bean to control the lifecycle and execute the actions (through jndi lookup). This however does not seem portable and correct against the jca specification. – Tom Monnier Mar 05 '15 at 15:44

1 Answers1

1

Apparantly I can answer my question myself.

When ResourceAdapter.start() is called, the provided BootstrapContext contains a XATerminator. This terminator exposes the lifecycle methods.

see

http://docs.oracle.com/javaee/6/api/javax/resource/spi/ResourceAdapter.html http://docs.oracle.com/javaee/6/api/javax/resource/spi/BootstrapContext.html

When ready to execute work, generate a XID, set it on the ExecutionContext and pass that execution context to the workmanager. (you probably need to implement a custom XID implementation)

see chapter 15 Transaction inflow of the jca 1.6 specification.

  • wouldn't you have some example on the transaction inflow? I mean where to get connection on remote EIS and how to process notification (message) from EIS at some point of time and passing some work based on this notification to application server. I mean probably work manager will be used but example would be handy. – chalda Feb 03 '16 at 19:56