3
Vote

Projection Query. Deleted Sort Criteria. unhandled exception

description

1.xx Rev 6667:

Because the projection query paging didn't worked with the latest revision I tried to remove some of it elements (sorting, groups,etc). I started with the sorting criteria and retrieved an error. After that I went back to the projection query and it trows the following exception:

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
No row with the given identifier exists[Orchard.Projections.Models.SortCriterionRecord#2]
NHibernate.ObjectNotFoundException: No row with the given identifier exists[Orchard.Projections.Models.SortCriterionRecord#2] at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id) at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) at Orchard.Data.Providers.AbstractDataServicesProvider.OrchardLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) in D:\Mercurial\Futsal\Orchard 1.xx\src\Orchard\Data\Providers\AbstractDataServicesProvider.cs:line 114 at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) at NHibernate.Impl.SessionImpl.InternalLoad(String entityName, Object id, Boolean eager, Boolean isNullable) at NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session) at NHibernate.Collection.PersistentBag.InitializeFromCache(ICollectionPersister persister, Object disassembled, Object owner) at NHibernate.Cache.Entry.CollectionCacheEntry.Assemble(IPersistentCollection collection, ICollectionPersister persister, Object owner) at NHibernate.Event.Default.DefaultInitializeCollectionEventListener.InitializeCollectionFromCache(Object id, ICollectionPersister persister, IPersistentCollection collection, ISessionImplementor source) at NHibernate.Event.Default.DefaultInitializeCollectionEventListener.OnInitializeCollection(InitializeCollectionEvent event) at NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection collection, Boolean writing) at NHibernate.Collection.AbstractPersistentCollection.ReadSize() at NHibernate.Collection.PersistentBag.get_Count() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.<GetEnumerator>d__0.MoveNext() at Orchard.Projections.Controllers.AdminController.Edit(Int32 id) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation)

comments

sebastienros wrote Oct 24, 2012 at 1:13 AM

I can't repro any exception when deleting a sort criteria.

Could you give some detailed repro steps ?
Also, what is the paging issue you are referring to ?

Znowman wrote Oct 24, 2012 at 8:44 AM

I will try to create a repo by stepping through the code and see what happens. Problem is that I can't do I today because it's a home project. Hopefully I can do this tommorow.

It's an website which I started in 1.3 initially and upgraded Orchard release till now on 1.6rc. Once projection was released I used that for my lists and it all worked fine. Until I imported a lot content items by code:
like contentManager.New....contetmanager.Create...etc.

They are imported fine but I suspected that is has something todo with importing items by code and they are not correctly set in the projection query cached xml?

Znowman wrote Oct 24, 2012 at 8:46 AM

O btw: Paging didn't work, only the first page was shown. So that's why I tried to removed some filters,etc. but that resulted in the described errors. So the whole query is broken. I tried to create a new query with the same content and that one is working fine. So somehow my old query suddenly broke after the import and is not working any more.

Znowman wrote Nov 5, 2012 at 10:39 AM

I retrieved the error now also on a other project but now I have some more info:

In method OrchardLoadEventListener and class AbstractDataServicesProvider in line:

@event.Result = ProxyOrLoad(@event, entityPersister, keyToLoad, loadType);
i trows the exception:

No row with the given identifier exists[Orchard.Projections.Models.SortCriterionRecord#2]

nightwolf226 wrote Dec 11, 2012 at 2:26 PM

I just ran into this one (in prod. :) ). Had a query with a tagging filter, had a sort criteria by publishing date ascending, I deleted the sort criteria and it crashed.

CSADNT wrote Dec 14, 2012 at 9:21 PM

If you are using taxonomies in your query, this bug could be the reason (the correction is in the issue)
http://orchardtaxonomies.codeplex.com/workitem/79