> Then I think we'd be talking about a patch to get NH to work in this fashion > (AFAIK - someone correct me if I'm wrong).
I guess, as NH is thought to be used with dynamic proxies for now. > How are lazy-loading of abstract classes handled? (Presumably they're not?) What do you mean? abstract classes from which entities may inherit from? > > > > > > > > -----Original Message----- > From: Michael > Sent: Tuesday, December 07, 2010 3:32 PM > To: nhibernate-development > Subject: [nhibernate-development] Re: PostSharp and static proxy > > No. There is one class, the entity, which PostSharp makes implement > INHibernateProxy by modifying the IL. > > So all entities inherit from this interface. But the proxy-related > code is only executed when NH asks for it. > > On 7 d�c, 16:12, "Richard Brown \(gmail\)" <[email protected]> > wrote: > > I'm possibly still missing something ... are there still two classes? > > (the > > 'real' one, and a second proxy one that inherits from it?) > > > -----Original Message----- > > From: Michael > > Sent: Tuesday, December 07, 2010 2:35 PM > > To: nhibernate-development > > Subject: [nhibernate-development] Re: PostSharp and static proxy > > > Because PostSharp implements this interface statically, on compile > > time. It doesn't create proxies on the fly like castle does, for > > example. > > > On 7 d�c, 15:26, "Richard Brown \(gmail\)" <[email protected]> > > wrote: > > > Hi Michael, > > > > I've no idea if this helps, but out of interest why do the non-proxied > > > entities implement INHibernateProxy? > > > > Richard > > > > -----Original Message----- > > > From: Michael > > > Sent: Tuesday, December 07, 2010 2:11 PM > > > To: nhibernate-development > > > Subject: [nhibernate-development] PostSharp and static proxy > > > > Hello all, > > > > I've ported to PostSharp 2 and NH3 the bits ayende used to write, to > > > use static proxies for the entities, instead of dynamic with Castle or > > > LinFu. > > > > I was hopping not to have to modify the source code of NH, but > > > unfortunately I can't make the static proxies work without. > > > > All the entities implement the INHibernateProxy interface, whether > > > they are proxied or not. The difference between a proxied entity and a > > > normal entity consists on the NHibernateLazyInitializer, which is null > > > in the latter case, and not null in the former. > > > > The problem I have is that in NH's code base, there are some checks on > > > the "proxyness" of an entity which rely only on the entity > > > implementing INHibernateProxy. This makes NH thinks that all the > > > entities are proxied, and leads to errors. > > > > Ayende solved this problem with a few changes in NH's code base. I > > > thought I could avoid that, with the recent changes concerning the > > > decoupling from NH to the proxy part, but unfortunately I can't. > > > > How should I fix that properly? Do I have to modify NH's bits? > > > > Thanks in advance > > > > Mike
