Platform Framework
R24 AMR | Min(s) read

Transaction Models

This section details on the different online transaction models, their advantages and disadvantages, and configuration.

Online transactions are performed through JMS invocation. The MDBs handle incoming messages and perform EJBs invocations and EJBs process Temenos Transact requests by invoking OFS.BULK.MANAGER. On EJBs invocation return, Temenos Transact responses are sent to reply queues by MDBs. This one to one relationship between MDB and EJB is referred as a Temenos Transact channel. Each channel has its own parameters—OFS source, formatter, time out and transaction model.

EJBs could also be invoked synchronously through direct invocation.

For online processing, MDBs always use container managed transaction (configuration made at EJB level to fit a specific use case). However, you can also configure MDBs to avoid message re-processing depending on the EJBs setup.

The available transaction models are:

  • EJB Bean managed transaction.
  • End-to-end container managed transaction.
  • Container managed transaction with distinct MDB and EJB.
  • EJB Bean managed transaction with Java Transaction API (JTA).

EJB Bean Managed Transaction

JMS message and EJB processing are two different concepts.

Temenos Transact can manage multiple transactions within a single message based on the TRANSTART, TRANSEND or TRANSABORT JBC statements. However, it is not possible in this model, as these statements should be used only within a single EB.TRANS invocation. JMS messages sent through CALLJEE statements are also part of their own transaction.

When a WRITE statement is executed outside of a transaction without calling TRANSTART, the action is committed and a trace in the logs reports the same.

An incoming message is successfully processed, if the MDB onMessage() method is returned. Any re-delivered message must be considered and ignored at MDB level to avoid  re-processing of a request.

The advantages and disadvantages of this model are listed in the below table.

Advantages

Disadvantages

Fine grained transaction management at Temenos Transact level and this model helps the Temenos Transact validation process when a database rollback does not trigger a message re-delivery.

Global transaction at database level and global rollback are unavailable. CALLJEE messages are sent before request completion.

CALLJEE SYNC mode could be used.

Need to protect against re-delivered JMS messages, as JMS message processing and request processing are different.

End-to-End Container Transaction

In this model, all transactions from incoming message to sending response including database updates and CALLJEE messages are considered as a single (global) transaction at the container level.

The transaction is committed on successful return of the MDB onMessage() method. The TRANSTART, TRANSEND or TRANSABORT JBC statements are not considered.

The OFS.BULK.MANAGER flag requestCommitted notifies the container with setRollbackOnly() order to rollback all request processing, which in turn triggers a message redelivery.

However, this model cannot be used for Temenos Transact validation requests, as validation process requires database rollback and sends success status to the caller without triggering a message re-delivery.

The advantages and disadvantages of this model are listed in the below table.

Advantages

Disadvantages

Container manages the transaction keeping everything under the same scope.

Does not fit Temenos Transact validation process, if Temenos Transact needs to rollback database transaction only and message must not be re-delivered.

Messages can be safely re-delivered and sent for re-processing in case of error.

CALLJEE SYNC mode cannot be used and gets blocked.

Caller can manage the transaction commit or rollback in case of direct EJB invocation.

 

Container Transaction with Distinct MDB and EJB

In this model, all transactions including database updates and CALLJEE messages are considered as a single (global) transaction at the container level. A distinction is introduced between MDB and EJB containers and any rollback order at EJB level does not trigger a message re-delivery.

The transaction is committed on successful return of the MDB processMessage() method. The TRANSTART, TRANSEND or TRANSABORT JBC statements are not considered.

The OFS.BULK.MANAGER flag requestCommitted notifies the container with setRollbackOnly() order to rollback the EJB request processing.

The advantages and disadvantages of this model are listed in the below table.

Advantages

Disadvantages

EJB container manages the transaction keeping databases updates and CALLJEE under the same scope.

Need to protect against re-delivered JMS messages, as JMS message processing and request processing are different.

Fits Temenos Transact validation process with database rollback including CALLJEE.

CALLJEE SYNC mode cannot be used and gets blocked.

Caller can manage the transaction commit or rollback in case of direct EJB invocation.

 

EJB Bean with Java Transaction API (JTA)

This model is similar to the Container with Distinct MDB and EJB, except that it is the EJB which manages the transaction.

In this model, all transactions including database updates and CALLJEE messages are considered as a single (global) transaction if the EJB option JTA mode is set to true. Any rollback order at EJB level does not trigger a message re-delivery.

The transaction is committed on successful invocation of UserTransaction.commit() within the EJB processMessage() method. The TRANSTART, TRANSEND or TRANSABORT JBC statements are not considered.

The OFS.BULK.MANAGER flag requestCommitted rolls back the user transaction.

The advantages and disadvantages of this model are listed in the below table.

Advantages

Disadvantages

EJB manages the transaction keeping everything under the same scope.

Need to protect against re-delivered JMS messages, as JMS message processing and request processing are different.

Fits Temenos Transact validation process with database rollback including CALLJEE.

CALLJEE SYNC mode cannot be used and gets blocked.

 

Caller cannot manage the transaction commit or rollback in case of direct EJB invocation.

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 5:10:25 PM IST