I try to do the following:

                        var session = factory.OpenStatelessSession();
                        var query = session.CreateQuery("from FeedItem f where 
f.Feed.Id
= :id");
                        query.SetGuid("id", new Guid("F7A8E6BD-
AC88-48D0-85F9-2A8999083C72"));
                        var result = query.List<FeedItem>().AsQueryable();

but I get the following error:

NHibernate.AssertionFailure: possible non-threadsafe access to the
session
bij NHibernate.Engine.TwoPhaseLoad.InitializeEntity(Object entity,
Boolean readOnly, ISessionImplementor session, PreLoadEvent
preLoadEvent, PostLoadEvent postLoadEvent)
bij NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList
hydratedObjects, Object resultSetId, ISessionImplementor session,
Boolean readOnly)
bij NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
QueryParameters queryParameters, Boolean returnProxies)
bij NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections
(ISessionImplementor session, QueryParameters queryParameters, Boolean
returnProxies)
bij NHibernate.Loader.Loader.DoList(ISessionImplementor session,
QueryParameters queryParameters)

mapping:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="AdSword.Common.Model.Feeds" assembly="AdSword.Common"
default-access="backfield">
        <class name="FeedItem" table="FeedItems" proxy="IFeedItem">
                <id name="Id" type="Guid">
                        <generator class="guid.comb"></generator>
                </id>

                <property name="UniqueId" not-null="true" unique="true" />
                <property name="Title" not-null="true" />
                <property name="Description">
                        <column name="Description" sql-type="text" />
                </property>
// snip properties
                <many-to-one name="Feed" column="FeedId" class="Feed" 
lazy="false" /
>
        </class>
</hibernate-mapping>

Feed is a simple entity (FeedId / Name)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to