Improvements for RELEASE(DEALLOCATE) processing
Db2 11 offers improvements that make the RELEASE(DEALLOCATE) bind option the best choice in more situations.
The RELEASE(DEALLOCATE) bind option causes resources for Db2 packages to be freed when the threads that are associated with the packages are deallocated. This behavior provides an opportunity for better performance for many applications. However, in previous releases of Db2, a limitation of RELEASE(DEALLOCATE) behavior was that it was not possible for data definition statements or bind operations to break in to long-running applications. The following improvements in Db2 11 overcome this limitation.
- Break-in for active threads
- The new PKGREL_COMMIT subsystem parameter specifies whether, at
COMMIT or ROLLBACK, a persistent Db2 thread
releases a package that is active on that thread if certain Db2 operations are waiting for exclusive
access to that package. If you specify YES,
for packages that are bound with the RELEASE(DEALLOCATE) option, the
following operations are permitted at COMMIT or ROLLBACK while the
package is active and allocated by Db2 for a persistent Db2 thread:
- BIND PACKAGE with REPLACE and REBIND PACKAGE requests, including automatic rebind online schema changes for tables and indexes that are statically referenced by the package
- Online REORG operations that materialize pending definition changes for objects that are statically referenced by the package
With this improvement, you no longer must identify and stop persistent Db2 threads that are running packages that are bound with the RELEASE(DEALLOCATE) bind option before you attempt BIND PACKAGE with REPLACE and REBIND PACKAGE requests, or apply schema changes that are associated with those packages.
- Break-in for idle threads
- If a package lock is likely to time out, Db2 recycles any idle threads that use local attachment facilities, such as CICS®, IMS, or RRSAF. A thread is eligible for recycling if it is has these characteristics:
- Is at a transaction boundary
- Is not running in Db2
- Has not committed or rolled back recently
If an application attempts to use an idle thread during the recycle processing, use of the thread is delayed until the recycle process is complete.