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

Reply via email to