2.2.6.1. Existing Transaction Service implementations

JCR proposes out of the box several implementations, they all implement the abstract class org.exoplatform.services.transaction.impl.AbstractTransactionService. This main class implement the biggest part of all the methods proposed by the TransactionService. For each sub-class of AbstractTransactionService, you can set the transaction timeout by configuration using the value parameter timeout that is expressed in seconds.

JOTM in standalone mode

To use JOTM as TransactionManager in standalone mode, simply add the following component configuration:


<component>
    <key>org.exoplatform.services.transaction.TransactionService</key>
    <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
    <!-- Uncomment the lines below if you want to set default transaction timeout that is expressed in seconds -->
    <!--init-params>
        <value-param>
            <name>timeout</name>
            <value>60</value>
        </value-param>
    </init-params-->
</component>

Generic TransactionService

If you intend to use JBoss Cache, you can use a generic TransactionService based on its TransactionManagerLookup which is able to automatically find the TransactionManager of several Application Servers thanks to a set of JNDI lookups. This generic TransactionService covers mainly the TransactionManager lookups, the UserTransaction is actually simply the TransactionManager instance that has been wrapped. See the configuration example as below:


<!-- Configuration of the TransactionManagerLookup -->
<component>
  <key>org.jboss.cache.transaction.TransactionManagerLookup</key>
  <type>org.jboss.cache.transaction.GenericTransactionManagerLookup</type>
</component>
<!-- Configuration of the TransactionService -->
<component>
  <key>org.exoplatform.services.transaction.TransactionService</key>
  <type>org.exoplatform.services.transaction.jbosscache.GenericTransactionService</type>
  <!-- Uncomment the lines below if you want to set default transaction timeout that is expressed in seconds -->
  <!--init-params>
     <value-param>
        <name>timeout</name>
        <value>60</value>
     </value-param>
  </init-params-->
</component>

Specific GenericTransactionService for JBoss Cache and Arjuna

If you intend to use JBoss Cache with Arjuna, you can use a more specific GenericTransactionService. It is mostly interesting in case you want to use the real UserTransaction. See the configuration example as below:


<!-- Configuration of the TransactionManagerLookup -->
<component>
  <key>org.jboss.cache.transaction.TransactionManagerLookup</key>
  <type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
</component>
<!-- Configuration of the TransactionService -->
<component>
  <key>org.exoplatform.services.transaction.TransactionService</key>
  <type>org.exoplatform.services.transaction.jbosscache.JBossTransactionsService</type>
  <!-- Uncomment the lines below if you want to set default transaction timeout that is expressed in seconds -->
  <!--init-params>
     <value-param>
        <name>timeout</name>
        <value>60</value>
     </value-param>
  </init-params-->
</component>

A very specific TransactionService for JBoss AS

If you intend to use JBoss AS with JBoss Cache, you can use a very specific TransactionService for JBoss AS. See the configuration example as below:


<component>
    <key>org.exoplatform.services.transaction.TransactionService</key>
    <type>org.exoplatform.services.transaction.impl.jboss.JBossTransactionService</type>
    <!-- Uncomment the lines below if you want to set default transaction timeout that is expressed in seconds -->
    <!--init-params>
        <value-param>
            <name>timeout</name>
            <value>60</value>
        </value-param>
    </init-params-->
</component>

TransactionsEssentials in standalone mode.

To use TransactionsEssentials, simply add the following component configuration:


<component>
  <key>org.exoplatform.services.transaction.TransactionService</key>
  <type>org.exoplatform.services.transaction.impl.atomikos.TransactionsEssentialsTransactionService</type>
  <!-- Uncomment the lines below if you want to set default transaction timeout that is expressed in seconds -->
  <!--init-params>
     <value-param>
        <name>timeout</name>
        <value>60</value>
     </value-param>
  </init-params-->
</component>
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus