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.
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()’
Replication Server uses the rs_dsi_check_thread_lock function to check whether or not the current DSI executor thread is blocking another replicate database process. It is executed only when more than one DSI thread is defined for a connection with dsi_commit_control set on, and a DSI executor thread is ready to commit, but cannot because it is not “next” to commit, and the amount of time specified for dsi_commit_check_locks_intrvl has elapsed.
The function string rs_dsi_check_thread_lock query is expected to return a single integer value, column name of <seq>. 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.
rs_dsi_check_thread_lock has function string class scope.
Replication Server creates an initial rs_dsi_check_thread_lock function string for the system-provided function string classes during installation.
You must create a function string for the rs_dsi_check_thread_lock function string, if you are using a custom base function string and you want to use the parallel DSI with dsi_commit_control set to on. Otherwise, you do not need to create a function string for this function.
Create or customize an rs_dsi_check_thread_lock function string at the Replication Server deployed at the primary site for the class.