rs_dsi_check_thread_lock

Description

Determines whether or not the DSI executor thread is holding a lock that blocks a replicate database process. A return value greater than 0 indicates that the thread is holding resources required by another database process, and that the thread should roll back and retry the transaction.

Examples

Example 1

Creates the rs_dsi_check_thread_lock function string that checks whether or not the current DSI executor thread is blocking another replicate database process.

create function string rs_dsi_check_thread_lock
for sqlserver_derived_class
output language
'select count(*) as seq from master..sysprocesses 
where blocked = @@spid and suid = suser_id()’

Usage

See also

create function string, alter function string