This project is read-only.


Queries do not Import in Recipes


If you export a Query and then put it into a recipe and try to import it to a new site, it will fail with an NHibernate.HibernateException as seen below. Attached is a recipe named "Test" which illustrates the problem with a very simple query for the BlogPost content type.

This is a copy of the default recipe with two changes:
1) Added Orchard.ImportExport and Orchard.Projections to the Features.
2) Added Query and ProjectionPage elements to the Data section.

2012-02-15 16:33:37,245 [5] NHibernate.Impl.AbstractSessionImpl - DTC transaction prepre phase failed
NHibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: Orchard.Projections.Models.QueryPartRecord.FilterGroups
at NHibernate.Engine.Collections.ProcessDereferencedCollection(IPersistentCollection coll, ISessionImplementor session)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushCollections(IEventSource session)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoNetWithDistrubtedTransactionFactory.DistributedTransactionContext.System.Transactions.IEnlistmentNotification.Prepare(PreparingEnlistment preparingEnlistment)

file attachments

Closed Feb 24, 2012 at 7:26 PM by sebastienros


kevink wrote Feb 24, 2012 at 6:28 PM

It looks like this one can be closed. The error is no longer happening on the latest 1.x tip, so I assume some other change fixed this issue.

However, there are a couple properties still not importing on Layouts. I submitted a pull request for that: