|
From: Bill S. <bil...@ya...> - 2006-07-28 04:36:36
|
Comments inline: --- Colin Yates <col...@gm...> wrote: > Actually, althought the javadoc doesn't explicitly > mention it (and is quite > badly worded actually) load won't hit the database > if your class is proxied. > This is mentioned in the reference documentation > (section 10.3) and is > encapsulated in the > org.hibernate.event.def.DefaultLoadEventListener. > > Given these semantics are defined by Hibernate I am > not really sure that > Spring should change the behaviour as it would quite > unintuitive. > > To our original question, I believe even if the > class *is* lazy loaded, load > would still hit the database to confirm identity but > that is an assumption > and I haven't traced it through to verify that > behaviour. The Javadocs do > make it clear that load should only be used for > known persistent objects, if > in doubt, use get. > Ok cool, thanks for your help - I appreciate it. I can send you my code that gave me this error if you'd like. > Col > > P.S. I think I will write a couple of tests to > verify this behaviour and > will get back to you. That'd be great. Thanks again, Bill __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |