Hi, is there any known trouble about Nhibernate 3.1 and no-proxy laziness? I moved from Nhibernate 2.1.2.4000 to 3.1.4000 and with a mapping like this one:
<?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="myNamespace" assembly="myAssembly"> <class name="Comment" table="comments_tb"> <id name="Id" column="idComment" unsaved-value="0"> <generator class="native" /> </id> <property name="isEnabled" column="isEnabled" access="field"/> <many-to-one name="Post" lazy="no-proxy"/> </class> </hibernate-mapping> When I try session.CreateCriteria(myClassMetaData.Value.GetMappedClass(EntityMode.Poco)).SetMaxResults(1).List() i get NHibernate.Exceptions.GenericADOException: could not execute query [...the query...] ---> System.NotSupportedException: Specified method is not supported. stacktrace: NHibernate.Proxy.AbstractProxyFactory.GetFieldInterceptionProxy() NHibernate.Tuple.PocoInstantiator.Instantiate() NHibernate.Tuple.PocoInstantiator.Instantiate(Object id) NHibernate.Tuple.Entity.AbstractEntityTuplizer.Instantiate(Object id) NHibernate.Persister.Entity.AbstractEntityPersister.Instantiate(Object id, EntityMode entityMode) NHibernate.Impl.SessionImpl.Instantiate(IEntityPersister persister, Object id) NHibernate.Impl.SessionImpl.Instantiate(String clazz, Object id) NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr, Int32 i, ILoadable persister, EntityKey key, LockMode lockMode, String rowIdAlias, EntityKey optionalObjectKey, Object optionalObject, IList hydratedObjects, ISessionImplementor session) NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[] persisters, EntityKey[] keys, Object optionalObject, EntityKey optionalObjectKey, LockMode[] lockModes, IList hydratedObjects, ISessionImplementor session) NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, LockMode[] lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean returnProxies) NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) NHibernate.Impl.CriteriaImpl.List(IList results) NHibernate.Impl.CriteriaImpl.List() With Nh version 2.1.2.4000 it worked fine and I've noticed that changing the laziness attribute there aren't any issues and it looks like related to Linfu bytecode provider. Any Idea? Thanks in advance Riccardo -- 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.
