Transactions support - Java-Springs

JCA specifies several levels of transaction support for resource adapters.The kind of transactions that your resource adapter supports is specified in its ra.xml file. There are essentially three options: none (for example with CICS EPI connector), local transactions (for example with a CICS ECI connector), global transactions (for example with an IMS connector).

<connector>
<resourceadapter>
<!-- <transaction-support>NoTransaction</transaction-support> -->
<!-- <transaction-support>LocalTransaction</transaction-support> -->
<transaction-support>XATransaction</transaction-support>
<resourceadapter>
<connector>

For global transactions, you can use Spring's generic transaction infrastructure to demarcate transactions, with Jta Transaction Manager as backend (delegating to the Java EE server's distributed transaction coordinator under neath).

For local transactions on a single CCI Connection Factory, Spring provides a specific transaction management strategy for CCI, analogous to the Data Source Transaction Manager for JDBC.The CCI API defines a local transaction object and corresponding local transaction demarcation methods.

Spring's CciLocal Transaction Manager executes such local CCI transactions, fully compliant with Spring's generic Platform Transaction Manager abstraction.

<jee:jndi-lookup id="eciConnectionFactory" jndi-name="eis/cicseci"/>
<bean id="eciTransactionManager"
class="org.springframework.jca.cci.connection.CciLocalTransactionManager">
<property name="connectionFactory" ref="eciConnectionFactory"/>
</bean>

Both transaction strategies can be used with any of Spring's transaction demarcation facilities, be it declarative or programmatic. This is a consequence of Spring's generic Plat form Transaction Manager abstraction, which decouples transaction demarcation from the actual execution strategy. Simply switch between Jta Transaction Manager and CciLocal Transaction Manager as needed, keeping your transaction demarcation as-is.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Java-Springs Topics