Guest User

Untitled

a guest
Nov 12th, 2014
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. System.InvalidOperationException
  2. Unexpected connection state. When using a wrapping provider ensure that the StateChange event is implemented on the wrapped DbConnection.
  3.  
  4. System.InvalidOperationException: Unexpected connection state. When using a wrapping provider ensure that the StateChange event is implemented on the wrapped DbConnection.
  5. at System.Data.Entity.Core.Objects.ObjectContext.EnsureContextIsEnlistedInCurrentTransaction[T](Transaction currentTransaction, Func`1 openConnection, T defaultValue)
  6. at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
  7. at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
  8. at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
  9. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
  10. at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
  11. at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
  12. at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
  13. at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
  14. at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  15. at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
  16.  
  17.  
  18.  
  19.  
  20. System.InvalidOperationException
  21. ExecuteReader requires an open and available Connection. The connection's current state is closed.
  22.  
  23. System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.
  24. at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
  25. at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
  26. at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
  27. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
  28. at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
  29. at Glimpse.Ado.AlternateType.GlimpseDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
  30. at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
  31. at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
  32. at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
  33. --- End of inner exception stack trace ---
  34. at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
  35. at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
  36. at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
  37. at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
  38. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
  39. at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
  40. at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
  41. at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
  42. at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
  43. at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  44. at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
  45.  
  46.  
  47.  
  48.  
  49. System.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
  50. at System.Data.Entity.Core.Objects.ObjectContext.ReleaseConnection()
  51. at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
  52. at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
  53. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
  54. at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
  55. at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
  56. at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
  57. at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
  58. at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  59. at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
  60.  
  61.  
  62.  
  63.  
  64. System.NullReferenceException: Object reference not set to an instance of an object.
  65. at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
  66. at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
  67. at System.Data.SqlClient.SqlConnection.Open()
  68. at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
  69. at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
  70. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
  71. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
  72. at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
  73. at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
  74. at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
  75. at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
  76. at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
  77. at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
  78. at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
  79. at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
  80. at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
  81. at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  82. at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
  83.  
  84.  
  85.  
  86. public string GetFriendlyUrlString(string originalUrl)
  87. {
  88. var friendly = _cacheManager.Get(originalUrl.ToLower(), () =>
  89. (from f in _friendlyUrlRepository.ReadOnlyTable <--------- LINE 48
  90. where f.OriginalUrl == originalUrl
  91. select f.Url).ToList().SingleOrDefault());
  92.  
  93. return friendly ?? originalUrl;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment