After well over a year of good performance, suddenly I am unable to save almost all razor templates in our dev environment. Also publishing (rendering) of items which use razor templates is extremely slow, like 100X slower. This only happens the first time the item is published, subsequent publishes of the item render at normal speed.
I've noticed on the CMS server that when the template is saved the Visual C# Command Line Compiler process is active and disappears when I am presented with the following error in the Tridion CMS interface:
The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.
Here is the full stack trace from the event viewer:
The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.
Component: Tridion.ContentManager.CoreService Errorcode: 0 User: NT AUTHORITY\NETWORK SERVICE StackTrace Information Details:
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Data.SqlClient.SqlCommand.DeriveParameters()
at System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command)
at Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.GetParametersFromStoredProcedure(String storedProcedureName)
at Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.GetStoredProcedureCommand(StoredProcedureInvocation storedProcedureInvocation)
at Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation storedProcedureInvocation)
at Tridion.ContentManager.Data.AdoNet.Sql.SqlDatabaseUtilities.ExecuteNonQuery(StoredProcedureInvocation storedProcedureInvocation)
at Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Tridion.ContentManager.Data.IIdentifiableObjectDataMapper.Update(IdentifiableObjectData data)
at Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs eventArgs)
at Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean checkInAfterSave)
at Tridion.ContentManager.CoreService.CoreServiceBase.Update(IdentifiableObjectData deltaData, ReadOptions readBackOptions)
at SyncInvokeUpdate(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Tridion.ContentManager.CoreService.CoreServiceInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
If I put a single line of garbage code into a razor template and save, after a very long time, 1 minute or so I get the expected razor compiler error.
Saving of any other type of Tridion object works fine. The QA environment is using the same database server and has no issues so I do not suspect the DB is the problem. No known changes have been made to the CMS server or DB.
I am using tridion 2013SP1 with a sql server 2012 db.
Anyone have any ideas?
Update:
after further investigation we are now seeing the problem moving to our other environments. I believe it may related to a windows update. In our load balanced environment one CMS node had the June Windows security updates installed, one node did not. The node without the updates installed worked properly the node with the updates installed did not. Unfortunately uninstalling the updates has not corrected the issue.