You are here: Blog » Tech tips

Tech tips

We found this nice tutorial by Gonçalo Marques covering basic two-phase commit with Spring, Tomcat and Atomikos.

Enjoy!

PS with our latest Tomcat integration - available to commercial subscribers - things are even easier smile

If you're into OSGi then you might want to check out our new OSGi documentation, explaining how to use Atomikos in OSGi (thanks to Pascal Leclercq).

Of course, this page will be updated once we support even more OSGi goodies - we have enough of those waiting in our backlog…

Atomikos is designed along the ports and adapters/hexagonal architecture as described here by Alistair Cockburn.

Among other things, this means that it is relatively easy to:
  • Implement new transaction APIs / standards / models
  • Add new types of two-phase commit resources

Examples of things we've been able to realize thanks to this:

  • JTA (port) / XA (adapter)
  • TCC (port/adapter)
  • RMI (port/adapter)

The port and adapter model is also an important concept in the new book Implementing Domain-Driven Design. Our domain is 2-phase commit. Our adapter is our Participant model. Our ports are all the ways you can interact with our core system.

It has happened a couple of times that people have asked me how to startup only the recovery part of their applications. While there is no built-in support in Atomikos (for now), here is a way to do it with Spring:

  • Concentrate your DataSource, ConnectionFactory and TransactionManager bean definitions in one config file, say infrastructure-config.xml (the term will sound familiar to those who practice Domain-Driven Design (DDD)
  • Use this config file in your application; this is your full runtime
  • Create a separate Main that initializes Spring with nothing else but this config; this will be your recovery-only rutime

Voila! Enjoy…

Interesting blog post on how to use DBCP in XA mode, with Atomikos as the JTA…

2018 update: the link seems to be broken by now - apologies for that.

Corporate Information

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

Contact Us

Copyright 2026 Atomikos BVBA | Our Privacy Policy
By using this site you agree to our cookies. More info. That's Fine