Symptoms
Consider the following scenario:
You may see a wait resource similar to the following when reviewing SQL activity:
Querying for locking behavior may show resources similar to the following:
- You are using SQL Server replication.
- You have multiple publications that publish data into one database at the subscriber(s).
You may see a wait resource similar to the following when reviewing SQL activity:
APP: 18:16384:[snapshot_delivery_in_progress_Tr]:(9bcdaf92)
APP: 5:16384:[snapshot_delivery_in_progress_Er]:(3c3b7db9) APP 16384:[appname]:(fbe42d68) X
APP 16384:[snapshot_del]:(9bcdaf92) XCause
This behavior is by design. It occurs because an application lock is used to prevent multiple replication agents from concurrently applying snapshots of different publications to the same subscriber database. Because the application lock contains the name of the subscriber database, any publications that publish into the same subscriber database will be impacted. The result is that only one snapshot can be inserted into the subscriber database at a given time.
Resolution
To work around this issue, specify a different subscriber database for each publication.
More Information
Exclusive locks are used in this situation to help avoid the possibility of replication agents becoming deadlocked with each other.