Great Query DSL

Update: Ayenda replied with the following

This is Rhino Commons repository + NHibernate Query Generator code.

Ayende posted an example of a great query DSL. Is this real? If so, where can I download this framework?

ICollection<Event> eventsInTwoDays = Repository<Event>.FindAll(        Where.Event.ScheduledDate == DateTime.Today.AddDays(2) &&        Where.Event.Participants.With(FetchMode.Join)    );
Advertisements

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()