BTM 1.3 final released

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

BTM 1.3 final released

Ludovic Orban
Administrator
Hi,

At last the final release of BTM 1.3 is ready for download after more than six months of incubation and a late night of testing.

The release can be downloaded here:
 http://docs.codehaus.org/display/BTM/Download

and the Maven2 artifacts and POM have been published to the central maven repository (please allow 24 hours for the propagation from the Codehaus servers to happen):
 http://repo1.maven.org/maven2/org/codehaus/btm/

Here is the list of what changed since 1.2:

 * BTM-4   Implement incremental recovery
 * BTM-7   Resource password is not decrypted when using the API
 * BTM-8   Durable subscribers cannot participate in XA
 * BTM-9   BitronixTransactionManager JNDI reference throws NPE on toString()
 * BTM-10  Race condition in connection pools when lazily initialized
 * BTM-11  Implement an embedded JNDI provider that allows to retrieve the TM and configured resources in a more standard way
 * BTM-12  add maven support
 * BTM-13  Implement ordering of XAResource during 2PC execution
 * BTM-14  Need the ability to have BTM invoke specific methods on JDBC connection upon return to the pool
 * BTM-17  Set tx status to marked_rollback on timeout
 * BTM-18  Invoke XAResource.setTransactionTimeout() when a resource is enlisted
 * BTM-19  No effect by setting auto-commit to false on LrcConnectionHandle
 * BTM-20  XAResourceManager incorrectly checking resource joinability
 * BTM-21  Differing journal-file lengths cause BTM to fail to start even if skipCorrectedLogs is true
 * BTM-22  Resource rollback not handled properly
 * Dropped all deprecated classes and methods.
 * Shutdown hook is not registered anymore when the TM starts up. It is now mandatory to shut it down manually.
 * Fixed incorrect transaction manager startup while using pools when BTM is not started.
 * Moved CryptoEngine to bitronix.tm.utils, kept bitronix.tm.internal.CryptoEngine but deprecated it.
 * Resource Loader cannot bind to JNDI anymore (no more needed, see: BTM-11), this obsoletes bitronix.tm.resource.bind property.
 * Transaction timeout logic has been rationalized, this obsoletes bitronix.tm.timer.transactionRetryInterval property.
 * Lowered statement cache overhead when it is disabled.
 * Fixed bug in the double LRC enlistment check that prevented safe cases from working.
 * Upgraded JTA and JMS jars to the latest 1.4-compiled version.
 * Added new configuration property 'journal' that allows to switch between the classic 'disk' journal and a new non-logging 'null' journal.
 * Upgraded SLF4J to version 1.5.2.
 * Fixed lots of misc bugs.

Important
Incremental recovery required a change in the Disk Journal's log format. Compatibility with older format (1.2 and below) has been maintained but journals created by BTM 1.3 cannot be read by older versions.

Documentation
The documentation at http://docs.codehaus.org/display/BTM/Home hasn't been updated to reflect all the changes of this new release. It will gradually be upgraded but most of its content is still valid.


It is strongly recommended for anyone testing any BTM 1.3 pre-release to upgrade to this version to make sure you benefit from all the latest bug fixes.


As usual, please report any bug / question / remark you might have here.

Thanks,
The BTM Team
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Arnaud Cogoluegnes
Hi Ludovic,

thanks for this new release!

the changelog mentions that you suppressed the shutdown hook. What are the implications, specially with web container integration, where (as far as I know) it's more difficult to control object lifecycle (compared to something like Spring)?
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Ludovic Orban
Administrator
The shutdown hook has been removed because it encourages bad design, can cause memory leaks and race conditions during shutdown.

BTM should be integrated directly into your webapp server. For Tomcat, that means writing a LifecycleListener while with Jetty it means writing a LifeCycle. This is not complex at all and allows the container to properly manage the transaction manager's lifecycle.

I'm going to update the documentation as soon as I can describing how to do that in details but here is very briefly how that should be done:

For Tomcat, write a class that implements http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/LifecycleListener.html with this lifecycleEvent method:

   public void lifecycleEvent(LifecycleEvent event) {
      if (Lifecycle.START_EVENT.equals(event.getType())) {
         TransactionManagerServices.getTransactionManager();
      }
      else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
         TransactionManagerServices.getTransactionManager().shutdown();
      }
   }

You should then JAR that class and copy the jar to the $TOMCAT_HOME/server/lib folder. Finally edit $TOMCAT_HOME/conf/server.xml and add this line below the other lifecycle listeners:

<Listener className="my.package.BTMLifecycleListener" />


For Jetty, It's basically the same idea. Implement http://www.mortbay.org/jetty-6/apidocs/org/mortbay/component/LifeCycle.html and start/stop the transaction manager in the start/stop methods and register it in your jetty.xml with a <Call name="addLifeCycle"> tag.


Let me know if you need more details.

Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Arnaud Cogoluegnes
does that mean the listener replaces this line in the context.xml (for tomcat):

<Transaction factory="bitronix.tm.BitronixUserTransactionFactory" />

?
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Ludovic Orban
Administrator
No, it doesn't. Most of the actual method is still good and actual.

With the LifecycleListener you can add it to $TOMCAT_HOME/conf/context.xml instead. That will make the transaction manager automatically available to all web applications.

Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Arnaud Cogoluegnes
I wrote the two listeners (for Jetty 6.1 and Tomcat 6.0), pretty simple and works fine. Perhaps these should be included in the BTM distrib, as they are now compulsory for clean app server integration (these kind of essential and not included classes remind me of SwingWorker or Hibernate.getCurrentSession, who ended up being included in their respective core).

just a note for Tomcat integration. In the context.xml, this is not valid anymore:

<Transaction factory="bitronix.tm.BitronixUserTransactionFactory" />

and should be replaced by:

<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />
Reply | Threaded
Open this post in threaded view
|

Re: BTM 1.3 final released

Ludovic Orban
Administrator
That makes sense. I will consider adding these classes into the next minor release. Would you please open a JIRA issue to make sure I'll remember ?

About the Tomcat documentation, I've fixed it.

Thanks,
Ludovic