Startup in recovery-only mode

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…

Comments are closed.