What is OLTP ?

Online Transaction Processing

OLTP Transaction is a unit of work performed by one or more programs, involving a specific set of input data and initiating a specific process or job.
In other hand, a single transaction can consists of one or more application programs to carry out the processing needed.



Some of the transaction characteristics are:

  • Minimum amount of data is processed and transferred per transaction
  • More numbers of users
  • Are executed in huge numbers
  • Transaction system able to support a high number of end users and different types of transactions concurrently.
  • Transaction system or online system is interaction between one or many users and the system.
  • Online systems are mission-critical applications; it requires continuous availability, high performance, and data protection and integrity.

Transaction processing is designed to maintain a database in a consistent state by ensuring that any operations carried out on the database are either all completed or cancelled successfully within a Unit of Work.
Online transaction processing (OLTP) is transaction processing that occurs interactively, it requires:

  • Quick response time
  • Continuous availability
  • Data integrity
  • Security

Some familiar online transactions:

  • ATM transactions
  • Debit or Credit cards payments
  • Internet purchases
  • Online ticket reservation.

Online system has many of an operating system characteristics:

  • Managing and dispatching tasks
  • Controlling user access authority to system resources
  • Managing the use of memory
  • Managing and controlling simultaneous access to data files
  • Providing device independence

Transactions from an OLTP system can serve requests from

  • Remote workstation program
  • Web page
  • Application in another transaction

In Transaction processing, the file containing most information about an organization’s business situation is called Master File and the file used to update the master file with transaction records is called transaction file.
Transaction file can be used as a temporary files during the online processing in OLTP system.

OLTP is characterized by

  • Short-time transactions
  • Several concurrent transactions
  • Database stores the actual state of the problem domain

A Transaction Processing Monitor (TM) manages and coordinates the flow of transactions through the system.
 


Requirement of a Transaction System

In a transaction system, transactions must comply with four primary
requirements known jointly by the mnemonic A-C-I-D or ACID:

  • Atomicity :- The processes performed by the transaction are done as a whole or not at all.
  • Consistency:- The transaction must work only with consistent information.
  • Isolation:- The processes coming from two or more transactions must be isolated from one another.
  • Durability:- The changes made by the transaction must be permanent.

A single transaction consist of many application programs that carry out the processing needed.  Large-scale transaction systems such as the IBM CICS product rely on the multitasking and multithreading capabilities of Z/OS to allow more than one task to be processed at same time.
Multitasking is essential in any environment in which thousands of users can be logged on at the same time.
Multithreading:- A single copy of an application can be processed by several transactions concurrently.  Multithreading requires that all transactional application programs be reentrant.
 


COMMIT or ROLLBACK of a Transaction System

  • In transaction systems, commit and roll back refers to the set of actions used to ensure that an application program either makes all changes to the resources represented by a single unit of recovery (UR), or makes no changes at all.
  • Two-phase commit protocol provides commit or rollback. That means it verifies either all changes or no changes are applied if one of the application or the system or the resource manager fails.
  • Two-phase commit protocol initiates restart or recovery process after the system or subsystem failure.
  • The instant when the syncpoint coordinator records the fact that it is going to tell all the resource managers to either commit or roll back is known as atomic instant.
  • On z/OS, the primary syncpoint coordinator is called Resource Recovery Services (RRS). During the first phase of two-phase commit process, the agents[RRS] do not know whether the syncpoint coordinator will commit or roll back the changes. This time is called the INDOUBT period.
  • The Unit of Recovery [UR] is described as having a particular state depending on what stage it is at in the two-phase commit process:
    • Before a UR makes any changes to a resource, it is described as being In-reset.
    • While the UR is requesting changes to resources, it is described as being In-flight.
    • Once a commit request has been made (Phase 1), it is described as being In-prepare.
    • Once the syncpoint manager has made a decision to commit (phase 2 of the two-phase commit process), it is In-commit.
    • If the syncpoint manager decides to back out, it is In-backout.

 


Role of CICS in Online Transaction Processing

What is CICS ?

CICS stands for Customer Information Control System and it is a transaction processing subsystem for Z/OS operating system. CICS provides services for running an application online, by request, at the same time as many other users are submitting requests to run the same applications, using the same files and programs.
An application developed under CICS, is a collection of related programs that perform a business operation. In other hand, CICS applications execute under CICS control, use CICS services, access programs and files. CICS Application programs can be written in COBOL, OO COBOL, C, C++, Java, PL/I, or Assembler language.
To develop and execute CICS applications, the programmer need to Understand the relationship between CICS programs, transactions and tasks.
Transactions :- is a piece of processing initiated by a single request.  The request is usually from an end user at a terminal or might be from a Web page or  from a remote workstation or from an application in another CICS system or trigger automatically or manually at a predefined time.
Application program:-  A single transaction consists of one or more application programs that, when run, carry out the processing needed.
Unit of Work:- a complete operation that is recoverable.
Task:- a single instance of the execution of a transaction.
Conversational transaction :-  A program conducts a conversation with a USER.  In CICS, when the programs being executed enter into a conversation with the user, it is called a conversational transaction.
In Conversational mode, the system waits for the User to enter his response along with an attention key, and while waiting the resources are held by the program or task.  So conversational mode of programming is inefficient.
In a transaction processing, a series of non-conversational transactions gives the appearance (to the user) of a single conversational transaction. It is called a pseudo-conversational processing.
Reentrance – Multiple users can share a single copy of a program during the same period.  In a reentrant program,  the program code cannot modify itself and the local data for each user process must be stored separately.
Reentrant programs are used in on-line systems and they make it possible for the operating system to establish a multithreading environment.
For all CICS Command level application programs, quasi-reentrancy is automatically ensured.
 


OLTP applications / system in Mainframe

CICS and IMS are the 2 products in Z/OS system, that provides environment to develop online screen.