In order for XA transactions to work properly, each Geronimo instance connecting to a resource manager such as an XA capable database or jms needs to have a globally unique and permanent Id.
each Geronimo instance connecting to a resource manager such as an XA capable database or jms needs to have a globally unique and permanent Id.
In Geronimo this id is a byte sequence configured in the XidFactory service in the transaction plugin. Do not change this while the server is running or while there are any in-doubt transactions anywhere in your system. This is the server identity as far as the xa system is concerned. For instance if a server becomes permanently unavailable due to hardware failure you can recover in-doubt transactions it is responsible for by setting up another server with the same apps and the dead server's TmId.
How to set the TmId (Geronimo 2.1.2, 2.2, and later)
Edit the line
in var/config/config-substitutions.properties to contain a unique byte sequence.
How to set the TmId (Geronimo 2.1.0 and 2.1.1)
Modify the var/config/config.xml file to look more like this (add the XidFactory element):
Again, use a unique byte sequence.
A very useful property that can be set here ist the defaultTransactionTimeoutSeconds. The default is approximately 900 seconds. So, if long running batch jobs are executing (in example scheduled by Quartz framework) in container, these jobs are canceld and database changes are rolled back by transaction manager at end of run. This is done even if all work was valid. So, you will never see an error monitoring the database