Modernization Hub

Access Intent

Enhanced Definition

In the context of mainframe database systems like DB2 for z/OS and IMS, **Access Intent** specifies how an application program intends to use data resources (e.g., rows, pages, segments) during a transaction. It informs the database manager whether the data will only be read or if it will be modified (inserted, updated, or deleted), directly influencing locking strategies and concurrency.

Key Characteristics

    • Concurrency Control: Access intent is crucial for the database manager to implement appropriate locking mechanisms, balancing data integrity with concurrent access for multiple applications.
    • Locking Granularity: It helps determine the type and duration of locks acquired (e.g., shared locks for read intent, exclusive locks for update intent) and their granularity (e.g., row, page, table in DB2; segment, block in IMS).
    • Performance Optimization: By declaring intent, the database system can optimize resource allocation and minimize contention, potentially avoiding unnecessary exclusive locks for read-only operations.
    • Transaction Isolation: Access intent plays a role in achieving different isolation levels (e.g., Repeatable Read, Cursor Stability) by guiding how locks are held and released throughout a transaction.
    • Application Declaration: Often implicitly derived from SQL statements (e.g., SELECT vs. UPDATE) or explicitly declared through API calls or program specifications (e.g., PCB processing options in IMS).

Use Cases

    • DB2 for z/OS SQL Statements: When an application executes a SELECT statement, DB2 typically infers a read intent, acquiring shared locks. For UPDATE, INSERT, or DELETE statements, an update intent is inferred, leading to exclusive locks.
    • IMS Program Specification Blocks (PSBs): In IMS, the processing options (PROCOPT) specified in a Program Specification Block (PSB) for a PCB (Program Communication Block) explicitly define the access intent (e.g., GO for Get Only, GU for Get Update, GHU for Get Hold Update).
    • Batch Processing: A batch job designed to generate a report might declare a read-only intent for its input files/databases, allowing other applications to concurrently update the data without contention for exclusive locks.
    • Online Transaction Processing (OLTP): An online CICS transaction updating a customer record will declare an update intent, ensuring an exclusive lock on that record to prevent other transactions from making conflicting changes simultaneously.

Related Concepts

Access intent is fundamental to concurrency control and locking mechanisms in mainframe database systems like DB2 and IMS. It directly influences the isolation level chosen for a transaction, impacting how data integrity is maintained amidst concurrent access. It is closely tied to transaction management, as the declared intent guides the database manager in acquiring and releasing locks throughout the transaction's lifecycle to ensure atomicity, consistency, isolation, and durability (ACID properties). It also impacts data sharing environments by coordinating access across multiple LPARs.

Best Practices:
  • Specify Minimal Intent: Always specify the least restrictive access intent necessary for your application to minimize locking contention and improve concurrency. Use read-only intent (GO in IMS, plain SELECT in DB2) whenever possible.
  • Understand Default Locking: Be aware of the default locking behavior of your database system (DB2, IMS) for different SQL statements or PSB options, as these defaults directly reflect inferred access intent.
  • Optimize Transaction Scope: Keep transactions as short as possible to reduce the duration of locks held, especially for update intents, thereby improving overall system throughput.
  • Use WITH UR (Uncommitted Read) in DB2 Judiciously: For reporting or batch jobs where reading uncommitted data is acceptable and performance is critical, SELECT ... WITH UR can avoid acquiring shared locks, but understand the potential for reading inconsistent data.
  • Review IMS PROCOPTs Carefully: For IMS applications, meticulously define the PROCOPT for each PCB in the PSB to accurately reflect the program's data usage, preventing unnecessary exclusive locks or data integrity issues.

Related Vendors

ABA

3 products

ASE

3 products

Tone Software

14 products

Trax Softworks

3 products

IBM

646 products

Related Categories

Operating System

154 products

Databases

211 products

Automation

222 products

Browse and Edit

64 products