Sitecore Publishing Service jobs fail with errors saying - The connection does not support MultipleActiveResultSets
Recently, a fellow Sitecorian reached out to know my views on a problem he was experiencing related to Sitecore Publishing Service 7. He reported that his publishing service has been configured correctly and was working fine when he checked last. Nothing has changed since then, and all of a sudden the publish jobs have started failing.
We jumped into the logs to find out what we can see and it had errors like the one below -
Error in the "TreeNodeSourceProducer"
System.InvalidOperationException: The connection does not support MultipleActiveResultSets.
at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__126_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
It seemed like the connectionstrings in sc.publishing.xml files were missing MultipleActiveResultSets=True. And it was true.
Why Sitecore Publishing Service connection strings need MultipleActiveResultSets=True?
Multiple Active Result Sets (MARS) is a feature that works with SQL Server to allow the execution of multiple batches on a single connection. When MARS is enabled for use with SQL Server, each command object used adds a session to the connection.
I checked Sitecore Publishing Service installation guide and it says -
SQL connection strings require that they support Multiple Active Result Sets (MARS), so when configuring a connection string, you must set MultipleActiveResultSets to true.
This basically means where ever we need to specify connection strings in Publishing service, we should set MultipleActiveResultSets=True along with the connection string.
Thanks for reading, hope it helps you!!
Comments
Post a Comment