Tuesday, February 3, 2009

Building transactional applications

I've been thinking about how we develop transactional applications for a very long time. That thought process got interrupted for a bit, but I came back to it over Christmas and recent events and articles have pushed this further. Plus we're working on transactional aspects for Drools 5 which has covered writing XAResources. Back in HP we had a tutorial on how to do this, which I think we're going to dust off and maybe Jonathan and the team will write some articles around that topic. (I know it's the subject of an update to the book, whenever that happens!)

But it got me thinking that as soon as people start asking about how they can write XAResources to make their data transactional then we really haven't progressed as an industry. XA is a good standard. But it's not perfect. (No standard is!) Plus it was designed with very specific database use cases in mind, which were fine 30 years ago but aren't always a perfect fit for the 21st century. The question should be "how do I make my data transactional?" and leave the implementation specifics to the engine or container.

We spent a great deal of time over the last 20 years making the development of transactional applications easier (HP was using Arjuna 20 years ago and liking it). Some PhD students wrote an entire database system based on it too. Simplicity, flexibility and power were keys to its success (nested transactions rule!) Back then there was little differentiation between the transaction engine and the way in which you developed applications. Subsequently we emphasized that they were different (Arjuna became known as the engine, while Transactional Objects for Java was the framework for developing applications).

However, we've not concentrated on the latter in recent years, which is a shame and something that we're going to remedy, because it's a proven way of developing flexible transactional applications. I think we'll throw in annotations and try to make it slightly less invasive than it was (back in the 1980's there was no such thing as Java let alone annotations). Hopefully we'll then be able to offer this to developers building on JBossTS and they can move away from asking "How do I write an XAResource?" to "What do my users want from my application/framework/service/..?" Leave the transaction complexity to JBossTS.

Side-note: while writing this I was reminded that we have a student project on some of these ideas, though not necessarily tied to TOJ. So if you are a student and looking for something to do, now may be the time to give it a go.

Friday, January 9, 2009

Tuesday, December 9, 2008

Web Services Test Forum

We've been working with IBM and others on the formation of the WSTF. Thanks to Andrew Dinn for the Web Services Transactions scenario work and Alessio Soldano for our WS-Addressing participation. Interoperability is something that I've been pushing for many years and we've always participated in as many of the official standards-based events as we possibly can. We're also members of WS-I and Apache Stonehenge, so you can be assured that Web Service interoperability will remain high on our agenda.

Monday, December 1, 2008

Java TOAST - A New Java Multi-threaded Test Automation Tool

I've been working on a Java test scripting tool which I have been using to help automate running of crash recovery tests for the JBossTS Web Service Transactions code. The tool is provisionally called Java TOAST (Thread Orchestration Automation Scripting Tool) and I'm planning to submit a presentation on it to Java One. I have also made the code available under the LGPL.

The tool uses the Java agent package (java.lang.instrumentation) and the ASM bytecode manipulation library to insert side effects or synthetic throws/returns at chosen 'trigger' points in application or JVM method code. Side effects are scripted using a simple event condition action language and the conditions and actions can include arbitrary invocations of Java code including reference to objects in context at the trigger point. Rules can be used to force 'wrong' or 'unexpected' behaviours to occur and to trace subsequent execution and propagate further side effects which ensure that it follows the desired path.

The tool is particularly oriented towards dealing with the problems involved in convincing non-deterministic, multi-threaded code to run in a reliable and repeatable manner. So, the rule language provides a suite of builtins which can be invoked from conditions or actions to orchestrate thread execution. These builtins implement operations such as delays, waits and notifies, countdowns, rendezvous, etc and can be used to make sure that events in the thread's life cycle happen with the desired timings or orderings. However, the tool is more general than this. So, even if you are just interested in running a simple single-threaded test it provides a very flexible means of scripting errant and aberrant behaviours in arbitrary application and/or JVM code and managing and tracing subsequent execution.

If anyone wants to take a look at the tool and or give it a road test the sources are in the JBossTS repository. There is a README which explains the basics plus how to compile and run the tool and a more complete user guide.
.

Thursday, June 26, 2008

JTS and WS-TX implementations go LGPL

Back when ArjunaTS was acquired by JBoss the decision was made to licence the core transaction engine (ArjunaCore) and the local JTA under LGPL, but use GPL for the OTS (JTS) implementation as well as for XTS, our Web Services Transactions component. There were some strategic decisions at the time (a dual-licence model) that made sense for JBoss, but with the Red Hat acquisition we've been reconsidering. As a result, the next release of JBossTS will be entirely based on LGPL, i.e., there will no longer be any GPL component. Hopefully this will satisfy those users and customers out there who wanted to use JTS or XTS but found that they were uncomfortable with GPL. From a community perspective, let's also hope that this helps encourage everyone to get behind JBossTS and continue to ensure it is the premier open source transaction engine out there. Next step: Project Blacktie.

Tuesday, April 15, 2008

DTF open sourced

Back in 2001 we had tens of hundreds of tests for the HP Transaction Service and a team of dedicated QA engineers. It took a week to run all of the tests across the combination of OS, hardware, JDK and database combinations. When we span out we didn't have those resources so had to develop the Distributed Test Framework, which is many ways is a Grid infrastructure: it supports the automatic deployment of services and software across arbitrary nodes, VM, OS etc. to execute tests and collate the results. It is truly distributed in nature and runs distributed tests (where the client(s) and service(s) run across different combinations of VM, hardware, OS, db etc.) We managed to have the same QA coverage with a fraction of the people and in a fraction of the time (and cost). I'm happy to say that we've finally open sourced it as well!