You are on page 1of 16

TAFJ-AS O nli n e

T r a n s a c ti o n
R20
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Amendment History:

Revisio
Date Amended Name Description
n

1 30th September 2015 JN Charpin Initial version

2 5th October 2015 JN Charpin Revision

3 14th March 2016 JN Charpin R16 AMR review

4 22nd June 2016 JN Charpin Revision

5 21st March 2019 Vinod S R19 AMR Review

Basheer
6 26th March 2020 R20 AMR review
Ahamed

Page 2
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Copyri g h t
Copyright © Temenos Headquarters SA 2009-2020. All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.

Errat a and Com m e n t s


If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department

Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland

Tel SB: +41 (0) 22 708 1150


Fax: +41 (0) 22 708 1160

Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com

Page 3
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Table of Contents
Copyright................................................................................................................................................ 3
Errata and Comments............................................................................................................................ 3
Overview................................................................................................................................................ 5
Prerequisite............................................................................................................................................ 6
Association between MDB and EJB...................................................................................... 6
Current configuration overview.............................................................................................. 6
Transaction models................................................................................................................................ 8
EJB Bean managed transaction............................................................................................ 9
Presentation....................................................................................................................... 9
Pros. and cons................................................................................................................... 9
Configuration................................................................................................................... 10
End to end container managed transaction........................................................................ 11
Presentation..................................................................................................................... 11
Pros. and cons................................................................................................................. 11
Configuration................................................................................................................... 12
Container managed requires new....................................................................................... 13
Presentation..................................................................................................................... 13
Pros. and cons................................................................................................................. 13
Configuration................................................................................................................... 14
EJB Bean managed with JTA enabled................................................................................ 15
Presentation..................................................................................................................... 15
Pros. and cons................................................................................................................. 15
Configuration................................................................................................................... 16

Page 4
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Overvi e w
TAFJ EE application is used to process online transaction in an application server context.

TAFJ JEE application is packaged within TAFJJEE_EAR.ear file which contains:

o TAFJJEE_MDB.jar : Message Driven Beans to handle JMS incoming


messages and send responses.

o TAFJJEE_EJB.jar : Enterprise Java Beans to process T24 requests.

MDB is used in this document for “Message Driven Bean”.

EJB is used in this document for “Enterprise Java Bean”.

MDBs and EJBs are configured by default through deployment descriptor packaged in above
mentioned jar files.

Java EE transaction management is being used.

http://docs.oracle.com/javaee/6/tutorial/doc/bncih.html

T24-Java supported application servers in R16 are Java EE6 compliant.

TAFJJEE_EAR file is shipped with a default configuration and could be changed easily
depending on specific need.

Each T24 online channel could have its own configuration. There is no better configuration
from another, the use case determines what should or should not be used.

The purpose of this document is to present the different transaction models, their pros. and
cons., and how they can be configured.

Page 5
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Prer e q u i s i t e
Please refer to TAFJ-AS TAFJ documentation for detailed explanation about application
server deployment and TAFJEE application architecture.

An understanding on how MDBs and EJBs are defined, configured and linked together is
required.

Ass o c i a t i o n be tw e e n MD B and EJB


MDB defines its associated EJB through the ejb-link attribute which refers to the ejb-name.

MDB definition: TAFJJEE_EAR.ear/TAFJJEE_MDB.jar/META-INF/ejb-jar-xml


<message-driven>
<display-name>Transacted Listener MDB for OFS</display-name>
<ejb-name>OFSTransactedMDB</ejb-name>
<ejb-class>com.temenos.tafj.mdb.TransactedMDB</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<ejb-local-ref>
<ejb-ref-name>ejb/OFSProcessingBeanLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.temenos.tafj.sb.OFSProcessingBeanLocal</local>
<ejb-link>OFSProcessingBean</ejb-link>
</ejb-local-ref>

</message-driven>

Associated EJB definition: TAFJJEE_EAR.ear/TAFJJEE_EJB.jar/META-INF/ejb-jar-xml


<session>
<display-name>TAFJ OFS Bean</display-name>
<ejb-name>OFSProcessingBean</ejb-name>
<business-local>com.temenos.tafj.sb.OFSProcessingBeanLocal</business-local>
<business-remote>com.temenos.tafj.sb.OFSProcessingBeanRemote</business-remote>
<ejb-class>com.temenos.tafj.sb.OFSProcessingBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>

</session>

Curr e n t con f i g u r a t i o n overvi e w


To have an overview of what is currently configured you could either use the sanity check
online tool by browsing:

http://localhost:8080/TAFJEE/sanitycheck/dashboard.xhtml

Page 6
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Or by using the standalone EARFileParser utility from TAFJ_HOME/bin.

i.e.

tafjHome\bin>EarFileParser -log
C:\development\demo\mavenDemo\target\demo\tafjHome\appserver\jboss\jboss6eap\TAFJJ
EE_EAR.ear

Will produce a sanitycheck.log containing the application configuration under

TAFJ_HOME/log/

Page 7
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Tran s a c t i o n mo d e l s
Online transactions are performed through JMS invocation.

MDBs are responsible to handle incoming messages and to do EJBs invocations. EJBs are
responsible to process T24 requests by invoking OFS.BULK.MANAGER.

On EJBs invocation return, T24 responses are sent to reply queues by MDBs. There is a one
to one relationship between MDB and EJB, this is what we call a T24 channel.

Each channel could have its own parameters: OFS source, formatter, time out and
transaction model.

EJBs could also be invoked synchronously through direct invocation.

For online processing MDBs are always using container managed transaction, this is at EJBs
level that configuration could be changed to fit a specific use case. However depending on
EJBs setup, MDBs configuration could also be tuned to avoid message re-processing.

The configurations presented below are:

- EJB Bean managed transaction.

- End to end container managed transaction.

- Container managed transaction with demarcation between MDB and EJB.

- EJB Bean managed transaction with JTA enabled.

Page 8
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

EJB Be a n ma n a g e d tran s a c t i o n

Pre s e n t a t i o n
There is a demarcation between JMS message and EJB processing.

T24 could manage multiple transactions within a single message based on jBC statements
TRANSTART / TRANSEND / TRANSABORT.

Although this is possible, there shouldn’t be multiple transactions as these statements should
be only used within a single EB.TRANS invocation.

JMS message(s) sent through CALLJEE statements are also part of their own transaction.

When a WRITE is performed outside a transaction (no TRANSTART being called), it will be
committed and a trace in the logs will report it (write outside of a transaction).

An incoming message is considered as successfully processed on return of the MDB


onMessage() method.

Re-delivered message have to be considered and ignored at MDB level to avoid a re-
processing of a request.

Figure 1. EJB bean managed transaction

Pros . and co n s .
Pros. Cons.

Fine grained transaction management at T24 No global transaction at database level, no


level. Required by T24 validation process global rollback available. CALLJEE
where database rollback must not trigger a message(s) are sent before request
message re-delivery. completion.

CALLJEE SYNC mode could be used. Need to protect against redelivered JMS
message as there is separation between
JMS message processing and request
processing.

Page 9
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Confi g u r a t i o n
The EJB transaction type must be set to Bean.

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_EJB.jar/META-INF/ejb-jar-xml


<session>

<ejb-name>OFSProcessingBean</ejb-name>
<ejb-class>com.temenos.tafj.sb.OFSProcessingBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>

</session>

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_MDB.jar/META-INF/ejb-jar-xml

MDB ignores re-delivered messages by default, no change required.

Page 10
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

End to en d con t a i n e r ma n a g e d tran s a c t i o n

Pre s e n t a t i o n
There is one unique global transaction from incoming message to response sending:
database updates, CALLJEE messages are part of same transaction.

The transaction is committed on successful return of the MDB onMessage() method.

T24 jBC statements TRANSTART / TRANSEND / TRANSABORT are not considered.

The OFS.BULK.MANAGER flag requestCommitted is considered to eventually rollback all


request processing by notifying the container with setRollbackOnly() order.

A rollback order sent to the container will trigger a message redelivery.

This mode cannot be used for T24 validation requests, as validation process requires
database rollback and send a success status to the caller without triggering a message re-
delivery.

Figure 2. End to end container managed transaction

Pros . and co n s .
Pros. Cons.

Container manages the transaction Doesn’t fit T24 validation process, where T24
everything is under same scope. needs to rollback database transaction only
and message must not be re-delivered.

Messages could be safely re-delivered and CALLJEE SYNC mode cannot be used and
sent for re-processing in case of error. will block.

In case of direct EJB invocation transaction


commit / rollback could be managed by
caller.

Page 11
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Confi g u r a t i o n
The EJB transaction type must be set to Container.

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_EJB.jar/META-INF/ejb-jar-xml


<session>

<ejb-name>OFSProcessingBean</ejb-name>
<ejb-class>com.temenos.tafj.sb.OFSProcessingBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

</session>

Associated MDB configuration could be changed to allow redelivered messages to be sent


for re-processing.

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_MDB.jar/META-INF/ejb-jar-xml

An env-entry section for property com.temenos.tafj.mdb.TransactedMDB/


ignoreRedeliveredMessage needs to be added and set to false.

<message-driven>
<ejb-name>OFSTransactedMDB</ejb-name>
<ejb-class>com.temenos.tafj.mdb.TransactedMDB</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<ejb-local-ref>
<ejb-ref-name>ejb/OFSProcessingBeanLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.temenos.tafj.sb.OFSProcessingBeanLocal</local>
<ejb-link>OFSProcessingBean</ejb-link>
</ejb-local-ref>

<env-entry>
<env-entry-name>com.temenos.tafj.mdb.TransactedMDB/ignoreRedeliveredMessage</env-en-
try-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>false</env-entry-value>
</env-entry>
</message-driven>

Page 12
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Cont a i n e r ma n a g e d req u i r e s ne w

Pre s e n t a t i o n
There is one unique global transaction per container, a demarcation is introduced between
MDB and EJB container.

Database updates, CALLJEE messages are part of same transaction but a rollback order at
EJB level will not trigger a message re-delivery.

The transaction is committed on successful return of the EJB processMessage() method.

T24 jBC statements TRANSTART / TRANSEND / TRANSABORT are not considered.

The OFS.BULK.MANAGER flag requestCommitted is considered to eventually rollback the


EJB request processing by notifying the container with setRollbackOnly() order.

Figure 3. Container managed transaction with demarcation between containers

Pros . and co n s .
Pros. Cons.

EJB container manages the transaction: Need to protect against redelivered JMS
databases updates and CALLJEE are under message as there is separation between
same scope. JMS message processing and request
processing.

Fit T24 validation process by just doing CALLJEE SYNC mode cannot be used and
database rollback. (CALLJEE is rollback as will block.
well)

In case of direct EJB invocation transaction


commit / rollback could be managed by

Page 13
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

caller.

Confi g u r a t i o n
The EJB transaction type must be set to Container.

A container transaction section for related EJB must be added at the end of the deployment
descriptor. It specifies that a new transaction is required when entering processMessage()
method.

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_EJB.jar/META-INF/ejb-jar-xml


<session>
<ejb-name>OFSProcessingBean</ejb-name>
<ejb-class>com.temenos.tafj.sb.OFSProcessingBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>


</session>

<assembly-descriptor>

<container-transaction>
<method>
<ejb-name>OFSProcessingBean</ejb-name>
<method-name>processMessage</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>

</assembly-descriptor>

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_MDB.jar/META-INF/ejb-jar-xml

MDB ignores re-delivered messages by default, no change required.

Page 14
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

EJB Be a n ma n a g e d with JTA ena b l e d

Pre s e n t a t i o n
Almost same configuration than EJB Container managed require new, except this is the EJB
which manages the transaction. When switching the EJB option JTA mode to true there will
be a global transaction at EJB level.

Database updates, CALLJEE messages are part of same transaction, a rollback order at
EJB level will not trigger a message re-delivery.

The transaction is committed on successful invocation of UserTransaction.commit() within


the EJB processMessage() method.

T24 jBC statements TRANSTART / TRANSEND / TRANSABORT are not considered.

The OFS.BULK.MANAGER flag requestCommitted is considered to eventually rollback the


user transaction.

Figure 4. Bean managed transaction with JTA enabled

Pros . and co n s .
Pros. Cons.

EJB manages the transaction everything is Need to protect against redelivered JMS
under same scope. message as there is separation between
JMS message processing and request
processing.

Fit T24 validation process by just doing CALLJEE SYNC mode cannot be used and
database rollback. (CALLJEE is rollback as will block.
well)

In case of direct EJB invocation transaction


could not be managed by caller.

Page 15
TAFJ-AS-o nli n e-t r a n s a c ti o n-s e t u p

Confi g u r a t i o n
The EJB transaction type must be set to Bean.

To enable JTA mode and make use of user transaction the above env-entry section must be
added to same EJB.

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_EJB.jar/META-INF/ejb-jar-xml


<session>

<ejb-name>OFSProcessingBean</ejb-name>
<ejb-class>com.temenos.tafj.sb.OFSProcessingBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>

<env-entry>
<description>OFS OFS Source</description>
<env-entry-name>com.temenos.tafj.sb.OFSProcessingBean/ofsSource</env-entry-
name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>GCS</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>com.temenos.tafj.sb.OFSProcessingBean/ofsTimeout</env-entry-
name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>60</env-entry-value>
</env-entry>
<env-entry>
<description>jTA</description>
<env-entry-name>com.temenos.tafj.sb.OFSProcessingBean/jTA</env-entry-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
</env-entry>

</session>

Configuration file: TAFJJEE_EAR.ear/TAFJJEE_MDB.jar/META-INF/ejb-jar-xml

MDB handles ignored re-delivered messages, no change required.

Page 16

You might also like