Atomikos Forum |
|
If more than one webapp inside Tomcat needs the UserTransactionManager, I run into problems. The first webapp which calls UserTransactionManager.init() is the master. The UserTransactionManager can only be closed by the master. So UserTransactionManager gets closed if the master webapp calls UserTransactionManager.close() and the other webapps lose there UserTransactionManager. So I changed the Lifecycle Listener from the Atomikos website to be the master to solve this issue.
public class AtomikosLifecycleListener implements LifecycleListener { private UserTransactionManager utm; public void lifecycleEvent(LifecycleEvent event) { try { if (event.getType().equals(Lifecycle.START_EVENT)) { if (utm == null) { utm = new UserTransactionManager(); utm.init(); } } else if (event.getType().equals (Lifecycle.AFTER_STOP_EVENT)) { if (utm != null) { utm.close(); } } } catch (Exception e) { Systerm.err.println("Exception" + e); } } }
I have found another entry for this issue from March 2009:
default82df.html?community.6.530.2 It could have saved me a lot of work, if I had found this information earlier.
Please feel free to register to contribute to our Atomikos Product Documentation wiki http://www.atomikos.com/Main/AtomikosRegistration
I will assign contributor rights to your account so if you change the Tomcat documentation others can benefit from the updated documentation.
Great. Checked it out http://www.atomikos.com/Documentation/Tomcat6Integration35
|