Have had discussions recently with various colleagues and clients about the way in which business-level transactions need to be implemented in a reliable way that also supports cancelling the actions that have been performed if and when something goes wrong in the process.

When using technology, the use of XA-compliant transaction managers and two-phase-commits give much of what is required. However, those facilities are not always available, and even when present they only cover a particular set of steps or actions in an overall process.

It is important to take a higher-level view of the operations being performed by the associated business process (not only BPEL and BPM, but the real business process, involving people and actions).

The need to unwind or roll back an operation, or sequence of operations, is not only down to technical updates in a database, but has to consider the implications this has on the business.

Where a plain rollback is not possible, there is a need to perform some form of ‘compensating transaction’ to correct the erroneous actions. This can be quite complex, depending on what update(s) went first, what auditing is required, how the updated data might already have been used, and what actions should follow the ‘corrective action’. In an SOA environment, this logic is also to be applied to the definition and implementation of services – if an ‘update’ service is provided, consider if there is a need to provide a related ‘revert update’ service that records the necessary information.

An architectural principle may be defined to state that application updates should not require compensating transactions, but in reality there will often be a need to do some form of update and change of processing.

Caution is required to avoid only performing basic updates to reverse the original transaction. From an accountancy perspective, this is often shown by a balancing transaction that negates the original entry, rather than removal of that older entry. Applications should correct data in the same way, making it easier to identify the sequence of events of the overall business process.

Looking again at the technical aspects, the implementation of multi-stage transactions begins with transaction handlers, which normally exist within the application framework or container (or the operating system itself). As more and more steps occur within a process up to the point at which a failure may arise, this requires additional routes for error handling to unwind the corresponding transactions and notifications.

This may be implemented using specific code in an application, but this may bring problems of its own in complexity and reliability, with maintenance also being made more difficult should any of the steps be changed. We have looked at how this error handling is implemented by the BPM tooling of WebSphere Process Server, and this does provide a clean way to applying compensating transactions based on the logic applied before identification of an error. That does seem to be a great benefit for complex business processes with automation in this way, but it isn’t exactly cheap if considered just as a way to wrap up error handling.

Anyway, discussions come up with various thoughts and recommendations as to how best this is solved for different situations. The most important thing to note is that analysis and design of business processes MUST address the approach taken to transaction handling in error conditions.

I’ve finally got round to reading this article on developerWorks. Things of interest that caught my eye:

  • There are some changes to the BPC Explorer such as more meaningful column names etc – worth knowing about as it has user impact.
  • Install time is supposed to be 1/3 what it was. Hurrah!
  • Maximum business object sizes for various deployment platforms are stated in the document as follows – “In a 64-bit environment the maximum size is now 500MB, while 32-bit UNIX systems can handle 100MB objects. Windows has a limit of 50MB due to the smaller heap size.
  • Cyclic flow activity – the ability to loop back to previous points in a process was a real pain in the past on a project I worked on, and this new BPEL extension makes this easier. It is an extension though, so needs to be used with caution I guess.

In general the feel of it is that IBM are gradually adding some of the capabilities there are available in MQ Workflow and Interchange Server, but which were too low down the priority stack for inclusion in a previous release.

Having recently done some work using WebSphere ESB and MQ, I came up with a list of IBM Redbooks that serve as useful references. Some of these are ‘must have’ documents for developers; others are good for additional background information. I’ll leave you to choose which.

All of these are available as electronic downloads (PDF files) from the IBM web site http://www.redbooks.ibm.com/ and are (mostly) identified with an eight-character id. I’ve included this id, plus a shortened form of the Redbook title, in the list below.

  • sg246963: WebSphere Product Family Redbook
  • sg247369: SOA Patterns, Design using WMB V6 and WESB
  • redp4191: WAS V6.1 Technical Overview (redpaper)
  • sg246451: WAS V6 System Management and Configuration
  • sg247413: WESB and WPS Production Topologies
  • sg247406: WESB SOA and SCA Connectivity
  • sg247212: WESB V6 Getting Started
  • redp4041: WPS and WID Technical Overview (redpaper)
  • redp4304: WBI V6.0.2 Performance Tuning (redpaper)
  • amqtac06: WMQ V6 for Windows, Quick Beginnings
  • csqzaf09: WMQ V6 Clients
  • amqzan09: WMQ V6 Using C++
  • csqzaw12: WMQ V5 Using Java
  • csqzal11: WMQ V6 Application Programming Guide
  • csqzak10: WMQ V6 Application Programming Reference
  • amqnar10: WMQ V6 Pub Sub User Guide
  • amqzag09: WMQ V6 System Administration Guide

There are plenty more in addition to this list, but I found these most relevant for the piece of work I was involved with.

You may also find it useful to view the set of SOA Patterns as published by IBM. These naturally focus on the use of IBM products, but even if you aren’t using their platform, the overall patterns still make sense. For instance, you can substitute your own flavour of ESB or messaging technology, your choice of application server environment, plus your web technology.