views:

59

answers:

2

I'm having a difficulty with naming the pattern used commonly by the application I've been working on for a while. Just to set the scene: this is a JEE application that uses messaging (JMS) a lot, persist data in relational database (JDBC) and relies on global transactions (XA) managed by the application server (JTA).

The pattern I'm talking about can be described as follows:

  • Start XA transaction using JTA transaction manager
  • Receive a message from the queue using JMS
  • Process the message by executing some business logic that may update the database tables (JDBS) and also send some other messages to the queues (JMS). It is important that all the operations are participating within ongoing transaction (unit of work).
  • At the end optionally send the message back or request forward.

In case of the uncaught exception the ongoing unit-of-work is being rolled back and the original message that triggered the process goes back to the queue for redelivery.

So, the question is how would you name such a pattern? Unfortunately I'm not aware of any good name for such a pattern, but I wouldn't be surprised if the pattern has already been names nicely.

+1  A: 

In the Enterprise Integration Patterns book by Gregor Hohpe and Bobby Woolf, this is simply called "Transactional Client".

markusk
A: 

Hi,

Transactional client indeed.

However, you could try the Atomikos variant, message-driven POJOs. It will take the burden of transaction control off of your application's back and results in much simpler code.

See http://www.atomikos.com/Publications/J2eeWithoutApplicationServer for more details.

HTH Guy

Guy Pardon