Actually I can't say much about it, we turned off lazy loading for the
moment because we didn't have the time to solve the problems we got.

Normally, inheritance shouldn't be a problem, because you shouldn't
care about actual types. You need to know that an entity could always
be a proxy. If you for instance expect the class names to be a certain
value (if (entity.GetType().Name == "MyEntity") or something) then it
could break. Also if you use reflection expecting the entity class or
expecting the inheritance hierachy.

With WCF we had the typical lazy loading problem that the proxy is
sent to the client, the client accesses it and the proxy tries to load
itself using the session that is not available. You need to load all
the data before you close the session on the server.

On Mar 18, 2:16 pm, graphicsxp <[email protected]> wrote:
> I intend to use WCF at one point indeed.  Also I have some inheritance
> in my classes too.
>
> What sort of issues can I get with the above ?
>
> On 18 mar, 10:43, Stefan Steinegger <[email protected]> wrote:
>
> > You should carefully decide if you want to use lazy loading (and these
> > proxies) by default. You could get issues with inheritance (the proxy
> > of a subclass is not derived from the proxy of the base class) or
> > serialization (eg. WCF). If you just want the old behaviour, you can
> > turn off lazy loading using lazy="false" in every class, subclass or
> > joined-subclass element.
>
> > Indeed, lazy loading is very powerful and you could give it a try.
>
> > On 18 Mrz., 11:34, graphicsxp <[email protected]> wrote:
>
> > > Ok, I was just surprised that it has changed so much between 1.2 and
> > > 2.0 ;)
>
> > > On 18 mar, 10:27, Gustavo Ringel <[email protected]> wrote:
>
> > > > There is no issue with the proxy, it just works this way. That's a 
> > > > dynamic
> > > > proxy from Castle.
>
> > > > Gustavo.
>
> > > > On Wed, Mar 18, 2009 at 12:22 PM, graphicsxp 
> > > > <[email protected]>wrote:
>
> > > > > Thanks, indeed my methods IsDeleted and IsChanged were not virtual and
> > > > > I had to do this.
> > > > > Any idea regarding the proxy thing ?
>
> > > > > On 18 mar, 10:15, Gustavo Ringel <[email protected]> wrote:
> > > > > > In NH 1.2 if you had somehing implementing an interface with a 
> > > > > > method
> > > > > > IsDeleted, you didn't have to set it as virtual.
>
> > > > > > From NH 2.0 also methods implementing an interface should be marked 
> > > > > > as
> > > > > > virtual. I'm not sure why this was changed but i remember of having 
> > > > > > this
> > > > > > problem.
>
> > > > > > Gustavo.
>
> > > > > > On Wed, Mar 18, 2009 at 11:43 AM, graphicsxp 
> > > > > > <[email protected]
> > > > > >wrote:
>
> > > > > > > Hello,
>
> > > > > > > After changing my NHibernate dll from 1.2 to 2.0, I receive the
> > > > > > > following errors when BuildSessionFactory() is called :
>
> > > > > > > The following types may not be used as proxies:
> > > > > > > DataTransfer.Cutting: method set_IsDeleted should be virtual
> > > > > > > DataTransfer.MediaElement: method set_IsDeleted should be virtual
> > > > > > > DataTransfer.Cutting: method set_IsChanged should be virtual
> > > > > > > DataTransfer.MediaElement: method get_IsDeleted should be virtual
> > > > > > > DataTransfer.MediaElementType: method set_IsChanged should be 
> > > > > > > virtual
> > > > > > > DataTransfer.Media: method AddMediaElement should be virtual
> > > > > > > .
> > > > > > > .
> > > > > > > .
> > > > > > > It goes on like that with all my Mapped entities.
>
> > > > > > > What is going on ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to