OpenTP1 Version 7 Programming Guide
If a deadlock occurs, OpenTP1 checks lock requests in terms of UAP lock wait priorities, selects those executed by UAP processes with lower priorities, and make the selected lock requests return with an error. The lock wait priority of a UAP is specified with deadlock_priority in the user service definition.
If a function called in an attempt to acquire a resource returns with an error because of a deadlock, the UAP must do the following:
If a deadlock occurs during SUP or SPP processing, roll back the transaction using a rollback function (dc_trn_unchained_rollback(), dc_trn_chained_rollback(), or tx_rollback()). The SUP or SPP which is rolled back because of a deadlock is not retried. Reissue the request for the service from the client UAP.
If a deadlock occurs during MHP processing, call the function dc_mcf_rollback() to roll back the transaction. Whether to retry the MHP can be specified in the argument to the function dc_mcf_rollback().
If a deadlock occurs, detailed information about the UAP which caused the deadlock is output to the directory for the node containing the lock service. This information is called deadlock information.
Suppose that a UAP is waiting for the release of a resource. If the waiting interval exceeds the time specified for lck_wait_timeout in the lock service definition, the function called from the UAP returns with an error. Detailed information about the resource which was about to be acquired can be output to the directory of the node containing the lock service. This information is called timeout information.
Whether to output deadlock information and timeout information can be specified for lck_deadlock_info in the lock service definition.
For details on the output formats of deadlock information and timeout information, see B. Output Format of Deadlock Information.
Deadlock information and timeout information can be deleted by either of the following methods:
If UAPs which are accessing multiple resource managers encounter a deadlock, OpenTP1 performs the following processing:
The UAP lock wait priorities specified for deadlock_priority in the user service definition are observed when handling this type of deadlock.
The lock waiting interval limit specified for lck_wait_timeout in the lock service definition is used for monitoring. Since RM-specific waiting interval limits are not referenced, do not forget to specify a lock waiting interval limit in the lock service definition.
Neither RM-specific waiting interval limits nor lock waiting interval limits as specified in the lock service definition are referenced. Instead, the transaction interval limit is used for monitoring UAPs. If the value given to trn_expiration_time in the user service definition, user service default definition, or transaction service definition is exceeded, the corresponding UAP process is terminated abnormally.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.