(Quick Reference)

2 Getting Started - Reference Documentation

Authors: Burt Beckwith

Version: 1.0

2 Getting Started

The first thing you need to do is install the plugin by adding a dependency in BuildConfig.groovy:

plugins {
   compile ':atomikos:1.0'
   …
}

Note that for Grails 2.3+ you need to add a dependency for spring-jms. This depends on the version of Spring that your Grails version uses, so look in the $GRAILS_HOME/lib/org.springframework/spring-jms/jars directory to see what version to use. You'll need something like this in the dependencies section of BuildConfig.groovy:

dependencies {
   compile 'org.springframework:spring-jms:3.2.4.RELEASE'
   …
}

Configuration

Ordinarily Atomikos is configured with a properties file named jta.properties but the plugin makes this simpler by letting you specify properties in Config.groovy. The configuration key is grails.plugin.atomikos.uts and the default values set by the plugin are

'com.atomikos.icatch.console_file_name': 'tm.out',
'com.atomikos.icatch.log_base_name': 'tmlog',
'com.atomikos.icatch.tm_unique_name': 'atomikosTransactionManager',
'com.atomikos.icatch.console_log_level': 'INFO',
'com.atomikos.icatch.log_base_dir': 'target/atomikos',
'com.atomikos.icatch.output_dir': 'target/atomikos',
'com.atomikos.icatch.force_shutdown_on_vm_exit': 'true'

You can override these in Config.groovy, e.g.

grails.plugin.atomikos.uts = [
   'com.atomikos.icatch.console_file_name': 'tm.out',
   'com.atomikos.icatch.log_base_name': 'tmlog',
   'com.atomikos.icatch.tm_unique_name': 'myTransactionManager',
   'com.atomikos.icatch.console_log_level': 'ERROR',
   'com.atomikos.icatch.log_base_dir': 'target/atomikos',
   'com.atomikos.icatch.output_dir': 'target/atomikos',
   'com.atomikos.icatch.force_shutdown_on_vm_exit': 'true']

Note that you can't override individual values since it's a single property - you need to keep any values that you want to retain, and add, remove, or change values that should be different.

See the Atomikos web site for a description of the various supported properties.