Nels, I didn't mean to offend you. Apparently, you really need this. I don't reference nhibernate on my client, so I don't have proxies on the client that will try to lazy load stuff as soon as somebody touches the property. They will just get a null exception (well, not, because I do initialize them).
So, then, here is a possibility of building something a lot of ppl want.
Jhusian: please take a look at the castle project. Hammet has created a nice nhibernate facility that has a class in it that delegates to a real session. I have not spent enough time there to give any real pointers, but I think the opportunity is this:
Implement the ISession interface, but every method just delegates to a real session. Implement the notion of 'being connected'. Check if you are connected or not, and if not, open an 'inner session' and then delegate the call to that session.
Actually, when I think about it, it might not even be too hard. However, I can't really say, because I'm trying to avoid proxying my classes and only lazy loading collections.
|