V1.4.1 Route upgrade to AutoRoute using Migrate to 1.4 module.SQL timeout

Topics: General, Troubleshooting
May 10, 2012 at 10:59 AM
Edited May 10, 2012 at 12:43 PM

I'm trying to upgrade my 1.3 instance to 1.4 and upgrade the routes to AutoRoute using the Migrate to 1.4 module. Unfortunately i'm getting the following errors in my log file and the apppool crashes because of it:

2012-05-10 12:47:22,853 [8] NHibernate.Util.ADOExceptionReporter - System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
   at NHibernate.Driver.NHybridDataReader.Read()
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
2012-05-10 12:47:22,855 [8] NHibernate.Util.ADOExceptionReporter - Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
2012-05-10 12:47:22,857 [8] Orchard.Alias.Implementation.Updater.AliasHolderUpdater - Exception during Alias refresh
NHibernate.ADOException: could not execute query
[ SELECT this_.Id as Id70_0_, this_.Path as Path70_0_, this_.RouteValues as RouteVal3_70_0_, this_.Source as Source70_0_, this_.Action_id as Action5_70_0_ FROM Orchard_Alias_AliasRecord this_ ORDER BY this_.Id asc ]
[SQL: SELECT this_.Id as Id70_0_, this_.Path as Path70_0_, this_.RouteValues as RouteVal3_70_0_, this_.Source as Source70_0_, this_.Action_id as Action5_70_0_ FROM Orchard_Alias_AliasRecord this_ ORDER BY this_.Id asc] ---> System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
   at NHibernate.Driver.NHybridDataReader.Read()
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
   --- End of inner exception stack trace ---
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
   at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
   at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session)
   at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
   at NHibernate.Impl.CriteriaImpl.List(IList results)
   at NHibernate.Impl.CriteriaImpl.List()
   at NHibernate.Linq.CriteriaResultReader`1.<GetEnumerator>d__0.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.Alias.Implementation.Storage.AliasStorage.List()
   at Orchard.Alias.Implementation.Updater.AliasHolderUpdater.Refresh()

The cause of this error is that i'm trying to upgrade many items at once (one content type at the time though). I have upgraded other content types successfully but the one which breaks has arround 9000 items. I would think 9000 is not that many for MS sql server, right?

May 11, 2012 at 10:00 AM
Edited May 11, 2012 at 11:22 AM

ok i've edited the upgrade module so that you can set an start index and a limit from the editor in the backend. And now it works without timeouts by upgrading 1000 items at the time.

If you are interested in the edited source. let me know!