I've noticed in debugging a replication implementation that use of the
SQLMerge object creates orphaned processes (which prevent subsequent
synchronization until explicitly terminated) if the application that starts
the merge process terminates abnormally (e.g. like stopping it in the
de*).
Once this happens, I can't synchronize again until I explicitly kill the
processes on the publisher/distributor. I see messages from the SQLMerge
object like:
"The merge process could not initialize the Publisher
'ECRIBMASTER2:Sample45'."
"{call master..sp_MScheck_agent_instance
(N'2BC53FAA-C0AA-436A-BBCA-6799E5FBFC0A', 4)}"
"Another merge agent for the subscription(s) is running."
Is there a way to prevent this from happening. The processes do not seem to
be cleaned up within any reasonable amount of time (e.g. even overnight),
and the replication monitor keeps showing the agent in a "retry" state until
I kill the process, even though the subscriber that started the merge
process is long gone.
Thanks,
Randy