Skip to main content

Maintaining data integrity in an IBM transaction processing and messaging middleware environment

Synchronization methods with CICS Transaction Server

Shyam Prakash (pshyam@in.ibm.com), Advisory Software Engineer, IBM
Author1 photo
Shyam Prakash is a IT Specialist/Test Architect for the IBM TXSeries project, at the India Software Lab. His experience includes development, Level 3 support, and the Lab advocate for IBM TXSeries products. His areas of interest include high-performance computing, cloud computing, transaction processing management and Unix systems.
Mangala G. Pujar (mangala.pujar@in.ibm.com), System Software Engineer, IBM
Author photo
Mangala is a software engineer in IBM, India Software Labs. She is currently working in TXSeries development team and has expertise in designing and developing middleware applications like TXSeries. Her areas of interest are transaction processing and UNIX systems.

Summary:  This article discusses the different synchronization levels supported by IBM® products like IBM TXSeries, CICS® Transaction Server, WebSphere® Application Server, and WebSphere MQ. It explains the role of synchronization in maintaining data integrity across the systems.

Date:  22 Apr 2009
Level:  Introductory
Activity:  636 views

Introduction

Current enterprise computing environments are an interconnection of distributed transaction processing and messaging middleware systems (legacy and distributed systems). Enterprise business data is spawned across such interconnected systems and databases in heterogeneous networks.

When designing applications that update data on more than one transaction processing and messaging middleware system, it is important to remember that network or system failures can occur that might result in data inconsistency. So it's essential to synchronise those interconnected systems to maintain data integrity. The mechanism to keep the recoverable resources (such as files, databases, and tables) in a consistent state across those interconnected systems is called synchronization (sometimes shortened to sync point). Sync points are implied at the beginning and end of a transaction.

This article discusses the importance of synchronization and the synchronization methods supported by various IBM transaction processing and messaging middleware systems when integrated with CICS Transaction Server (CICS TS).


Importance of synchronization

Consider a single system where an application moves records between two tables TABLEA and TABLEB, as shown in Figure 1. If a problem occurs, for example if data is corrupted in one of the files, or a transaction abends, the transaction processing monitor backs out the changes that were made before the problem occurred. Consequently, the data in the database return to their state at the time the transaction was initially invoked.


Figure 1. A simple transaction
Diagram of a simple transaction

Now consider the case where TABLEB resides on a remote system, as shown in Figure 2. The work of the application is effectively split into two transactions, TRN1 and TRN2. Because the application is distributed, it is now difficult for TRN1 running in the local system to detect problems with adding the record to TABLEB on the remote system. If TRN1 cannot detect these problems, then it might delete a record from TABLEA that has not been added to TABLEB, and cause the record to be lost.


Figure 2. A distributed transaction
Diagram of a distributed transaction

The solution is to use a form of acknowledgment processing so that the two transactions in the application can ensure that they each complete their task successfully. The exact form of this acknowledgment depends on the requirements of the application.

As shown in Figure 3, after TRN2 writes a record to TABLEB, it can send a message to TRN1, indicating that the record can be deleted from TABLEA.


Figure 3. Acknowledgement processing
Diagram of acknowledgement processing

Thus a record can never be lost, because TRN1 deletes the record from TABLEA only when it knows that the record is written to TABLEB. However, if TRN1 fails after it receives the message to delete the record, but before the record is actually deleted from TABLEA, the record appears twice, once in TABLEA and again in TABLEB.

In the next sections, we’ll look at methods for synchronizing data updates between transaction processing and messaging middleware products.


Synchronization methods

There are two methods through which synchronization is addressed with respect to CICS Transaction Server:

  • Synchronization levels
  • X/Open DTP XA

Let's look at each of these methods.

Synchronization levels

A two-way communication between two applications is called a conversation. The synchronization level (synclevel) specifies the degree to which the conversation is transactional. Since applications have different requirements, SNA defines three levels of support that allow an application to coordinate updates across a number of systems. These levels of support are called synchronization levels:

  • Synchronization level 0 (NONE): TPM (Transaction Processing Monitor) provides no synchronization support. The application must code its own.
  • Synchronization level 1 (CONFIRM): TPM provides the ability to send simple acknowledgment requests.
  • Synchronization level 2 (SYNCPOINT): TPM provides the ability for two or more TPM’s to treat the updates made by an application on these systems as one logical unit of work (LUW). When the application requests a synchronization point the updates on the remote systems are committed if, and only if, updates to recoverable data made locally by the transaction are also committed. If a failure occurs for example, the transaction abends before all involved systems have agreed to commit, all the updates for the application on each of the systems are backed out Alternatively all updates are backed out if the application issues Rollback.

X/Open DTP XA

X/Open DTP XA is a standard that every transaction manager implements to coordinate the resource managers connected with the transaction processing monitor. With this synchronization type, the transaction manager coordinates syncpoint, rollback, commit, and failure recovery of all work involved in the unit of work, including queues, files and resources that are managed by the resource manager.


Synchronization between TXSeries and CICS Transaction Server

TXSeries for Multiplatforms is a non-J2EE distributed transaction processing monitor, part of the IBM CICS family of products that provides business critical transaction and integration capabilities for enterprise environments.

TXSeries interoperates with CICS TS on z/OS using these methods:

  • Local SNA support
  • SNA support via the CICS PPC Gateway server

Using local SNA support

Local SNA support requires an appropriate SNA product to be installed and configured on the same machine as the TXSeries for Multiplatforms region. With local SNA support, you can use synchronization levels 0 and 1.

Figure 4 shows a TXSeries region in a distributed environment connecting to a CICS TS region on z/OS. It updates the DB2 database on the mainframe, therefore synchronization level 1 is sufficient to maintain data integrity.


Figure 4. Synchronization Level 1 using local SNA connectivity
Diagram of                     synchronization level 1 with local SNA

Using a PPC Gateway server to communicate across SNA

TXSeries can communicate with an SNA network by using a PPC Gateway server. CICS uses TCP/IP to communicate with the PPC Gateway server, and the PPC Gateway server provides a link to the SNA network.

A PPC Gateway server supports sychronization levels 0, 1, and 2.


Figure 5. Synchronization Level 2 using PPC Gateway server
Diagram of                     synchronization level 2 with PPC Gateway

Figure 5 shows a TXSeries Region on a distributed environment connecting to a CICS TS region on z/OS. This scenario spawns business data across a database connected to TXSeries and a database connected to CICS Transaction Server on z/OS. If the business logic updates the data in both of the databases, then it needs synchronization level 2. Therefore in this case you need to use PPCGateway Server to provide a synchronization level 2 mechanism between TXSeries and CICS TS.


Synchronization between WebSphere Application Server and CICS Transaction Server

WebSphere Application Server is a J2EE-based transaction processing manager available for a distributed environment, and for z/OS. In an enterprise environment, WebSphere Application Server needs to connect to CICS Transaction Server to utilize its services.

A J2EE transaction processing manager like WebSphere Application Server can connect to CICS TS by using the J2EE Connector Architecture (JCA), which defines a standard architecture for connecting the J2EE platform to heterogeneous enterprise information systems like CICS Transaction Server. WebSphere Application Server can connect to CICS TS using a gateway product called CICS Transaction Gateway. CICS Transaction Gateway provides JCA adapter facilities to connect and provide synchronization between WebSphere Application Server and CICS TS.

In this section we look at some topologies and details about the synchronization levels supported by the CICS Transaction Gateway resource adapters.

One-phase commit processing

Figure 6 shows the first topology, which uses the ECI resource adapter for one-phase commit processing (similar to sync level 1).


Figure 6. ECI resource adapter - one-phase commit processing
Diagram of one-phase                     commit processing

In this topology:

  • You use the CICS ECI resource adapter to integrate with CICS Transaction Server using CICS Transaction Gateway.
  • The CICS ECI resource adapter supports only the LocalTransaction interface. As a result, the scope of the transaction is limited to the Resource Manager (that is, the associated connection factory and the specified CICS server). Such Resource Manager local transactions support only one-phase-commit processing. So, if the enterprise bean shown in Figure 8 attempts to access another recoverable resource (for example, a JDBC call to update an IBM DB2® table), an exception occurs when the transaction manager tries to commit both updates.
  • If you use a J2EE application server that supports the JCA option of last-resource commit optimization, an interaction using an ECIConnectionFactory class can participate in a global transaction, provided that it is the only one-phase-commit resource in the global transaction.
  • The transactions are considered local to the respective application servers.

Two-phase commit between WebSphere Application Server and CICS TS on z/OS

Figure 7 shows a two-phase commit between WebSphere Application Server for the distributed environment, and CICS TS on z/OS (similar to sync level 2 support).


Figure 7. Two-phase commit processing using the ECI XA resource adapter
Diagram of two-phase commit                     processing using ECI XA adapter

In this topology:

  • You use the CICS ECI XA resource adapter to support two-phase-commit global transactions along with CICS Transaction Gateway for z/OS. Hence you can synchronize database updates from both ends.
  • One-phase-commit transactions using the CICS ECI resource adapter are also supported. Note that in either case, if you deploy the enterprise bean with a transactional deployment descriptor (for example, a value of REQUIRED), the resulting ECI request to CICS Transaction Server uses the transactional EXCI.
  • In this case, both CICS Transaction Gateway and CICS Transaction Server need to be configured to register with Resource Recovery Services (RRS) on z/OS.

Two-phase commit between WebSphere Application Server on z/OS and CICS Transaction Server on z/OS

Figure 8 shows a two-phase commit between WebSphere Application Server on z/OS and CICS TS on z/OS


Figure 8. Two-phase commit between WebSphere on z/OS and CICS Transaction Server on z/OS
Diagram of two-phase commit      between WebSphere on z/OS and CICS Transaction Server on z/OS

In Figure 8, Both WebSphere Application Server and CICS TS are configured on the same z/OS machine.

IP Interconnectivity (IPIC) support: CICS TS version 3.2 contains support for DPL (Distributed Program Link) to be routed over TCP/IP. This support is called IP Interconnectivity, or IPIC. TXSeries 7.1 for Multiplatforms and CICS Transaction Gateway 7.1 can integrate with CICS TS using IPIC. We will cover synchronizing through IPIC protocol in a future article.
  • RRS (Resource Recovery Services) provides the two-phase-commit, an integral part of z/OS. RRS acts as the external transaction coordinator for z/OS in managing the transaction scope between WebSphere Application Server, CICS Transaction Server and other z/OS subsystems, including IBM IMS Transaction Manager (IMS/TM), IMS/DB, DB2 and IBM WebSphere MQ systems.
  • Two phase commit processing is supported between CICS Transaction Server and WebSphere Application Server. Hence you can synchronize database updates from both ends.

Synchronization between WebSphere MQ and CICS Transaction Server

WebSphere MQ (Message Queue) is IBM’s premier messaging middleware product, which provides an available, reliable, scalable, secure, and maintainable transport for messages with delivery assurance.

WebSphere MQ acts as a resource manager when integrated with CICS TS. CICS TS coordinates the transactions and updates between WebSphere MQ and other resource managers using the CICS adapter for WebSphere MQ.

Synchronizing the start and end of units of work is necessary in a transaction processing environment to safely use transaction processing. This is fully supported by WebSphere MQ for z/OS in CICS, which means that the resource managers cooperate to commit or back out units of work in unison, under the control of CICS TS. Examples of resource managers are DB2, CICS File Control, and WebSphere MQ for z/OS.


Figure 9: Two-phase commit processing between WebSphere MQ on z/OS and CICS TS on z/OS
Diagram of two-phase commit                     processing between WebSphere MQ on z/OS and CICS TS on z/OS

In Figure 9:

  • You use WebSphere MQ as a resource manager.
  • You use WebSphere MQ-CICS for tighter integration with CICS to provide syncpoint support

Summary

Synchronization is a very important mechanism to understand when designing business critical applications. In this article we first looked at the importance of synchronization and various methods for synchronization. We saw that, based on the business logic, data updates and the environment, you need to choose the right products to provide an appropriate synchronization mechanism. We then provided the basics of how IBM transaction and messaging middleware products provide synchronization support in various ways when integrated with CICS TS. The intent of this article is to provide guidance on synchronization for architects who design business applications using IBM products.


Resources

Learn

Get products and technologies

About the authors

Author1 photo

Shyam Prakash is a IT Specialist/Test Architect for the IBM TXSeries project, at the India Software Lab. His experience includes development, Level 3 support, and the Lab advocate for IBM TXSeries products. His areas of interest include high-performance computing, cloud computing, transaction processing management and Unix systems.

Author photo

Mangala is a software engineer in IBM, India Software Labs. She is currently working in TXSeries development team and has expertise in designing and developing middleware applications like TXSeries. Her areas of interest are transaction processing and UNIX systems.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=383078
ArticleTitle=Maintaining data integrity in an IBM transaction processing and messaging middleware environment
publish-date=04222009
author1-email=pshyam@in.ibm.com
author1-email-cc=stephp@us.ibm.com
author2-email=mangala.pujar@in.ibm.com
author2-email-cc=stephp@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers