NHibernate/ActiveRecord Bug?

We receive the following exception when our system is under high load. Has anyone else seen this problem? Any ideas?

Exception type: ADOExceptionException message: could not initialize a collection:at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type)   at NHibernate.Loader.Collection.CollectionLoader.Initialize(Object id, ISessionImplementor session)   at NHibernate.Persister.Collection.AbstractCollectionPersister.Initialize(Object key, ISessionImplementor session)   at NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection collection, Boolean writing)   at NHibernate.Collection.AbstractPersistentCollection.ForceInitialization()   at NHibernate.Impl.SessionImpl.InitializeNonLazyCollections()   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)   at NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, Type optionalEntityName, Object optionalIdentifier, IEntityPersister persister)   at NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId)   at NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session)   at NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session)   at NHibernate.Impl.SessionImpl.DoLoad(Type theClass, Object id, Object optionalObject, LockMode lockMode, Boolean checkDeleted)   at NHibernate.Impl.SessionImpl.ImmediateLoad(Type clazz, Object id)   at NHibernate.Proxy.LazyInitializer.Initialize()   at NHibernate.Proxy.CastleLazyInitializer.Intercept(IInvocation invocation, Object[] args)   at CProxyTypeSIROffices_ModelLocationModel_NHibernate_ProxyINHibernateProxy_System_Runtime_SerializationISerializable2.get_Name()   at SIROffices.Model.Listing.FindLocationNodesByPropertyID(Int32 propertyId)   at SIROffices.Model.Listing.FindSalesNeighborhoodByLocationTree()   at SIROffices.Model.Listing.GetSalesNeighborhood()   at SIROffices.Model.Listing.get_SalesNeighborhood()Could not perform ExecuteQuery for SaleListingCastle.ActiveRecord.ActiveRecordBase.ExecuteQuery(IActiveRecordQuery query)   at Castle.ActiveRecord.ActiveRecordBase`1.ExecuteQuery2[R](IActiveRecordQuery`1 query)   at Castle.ActiveRecord.Queries.SimpleQuery`1.Execute()

4 Responses

  1. Please raise the question in the mailing list

  2. Hi,
    Are you able to fix it. This is NHibernate Lazy Loading issue, where NHibernate generates Transperant Proxies to handle Lazy Loading and the serialization doesn’t know how to serialize the contract (Interface). I am forced to use Assembler and DTO pattern to circumvent, eventhough I hate DTOs.
    Currently Breathing .NET

  3. It does not sound like we are talking about the same problem. The above lazy loading issue only occurred when the system was under heavy load. It seems, by your wording, you are getting an exception in every situation. Is this the case?

  4. You are right, in my case I am getting in every situation
    Currently Breathing .NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: