|
From: Bill S. <bil...@ya...> - 2006-07-26 04:05:53
|
Hi, I have a question about the load() methods on hibernate3's HibernateTemplate. Spring's javadoc for load() say that an exception will be thrown if the object is not found. However, from what I understand, Hibernate 3 changed its default behavior to lazy load all classes. This means that if you try to load an object with an ID that does not exist, a Hibernate error is not thrown because you get a proxy to the object that does not exist. It is only upon the first method call to that proxy that Hibernate's ObjectNotFoundException is thrown. I would think that in Spring's load() methods should force initilization of that object so that trying to load an object that does not exist immediately throws the correct Spring exception. I have attached a patch that should do the trick. I have never made a patch before, nor have I ever looked through the source of spring or hibernate, so please excuse any stupid mistakes :-) Thanks for a great product, Bill Six __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |