Sql-server – Locking And Blocking With Merge Replication

merge-replicationreplicationsql server

I am using merge replication in SQL 2012 with web sync.

When I insert records into the top tables in my filter hierarchy it causes a lot of locking on the tables, including the merge replication tables such as MSMerge_contents.

It means that no other process can insert into the same tables at the same time.

Because of my particular setup this is a problem. Is there a way to reduce the amount of locking / blocking that occurs in the merge replication insert triggers?

Best Answer

What is occurring here is not what it appeared to be. The stored procedure to write into my top level tables were using transactions.

It was the transactions that were causing heaps of extra locks. It worked fine once those transactions were removed.