5

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.

2 Answers 2

3

Looking at the error, it feels like that database is timing out. That is the case when you will see error

"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."

The reason why second publish onward the publish is smooth and doesn't take time is because of caching objects feature on publisher so recently published items are cached which makes it faster through publishing.

The solution for your situation:

  1. Use template builder to debug through the different phases of rendering and time taken by each phase.
  2. Work with DBAs to perform database maintenance (like re-indexing) and schedule weekly maintenance job of the database.

If above solution doesn't provide any help then please reach out to support.

1
  • 2
    I will work with the DBA tomorrow but 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 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. I'm a bit concerned as the razor mediator is not an official SDL product.
    – Nate Niemi
    Jun 30, 2016 at 22:59
2

It turns out the issue was related to a known bug in some versions of VMWare Tools. When it was updated to a stable version the issue was resolved.

1
  • 1
    Nasty one! Glad you could figure it out - it probably impacts other template mediators, not just Razor.
    – Nuno Linhares
    Jul 6, 2016 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.