[samigo-team] use of hibernatetemplate.load

Aaron Zeckoski azeckoski at unicon.net
Thu May 9 04:47:46 PDT 2013


load() also returns a proxy instead of the actual object in some cases
(thus allowing for a lazy load of the content) so be careful with this
change. You might really hurt performance (or it might have no impact
depending on how quickly the object data is accessed).

-AZ


On Thu, May 9, 2013 at 7:22 AM, David Horwitz <david.horwitz at uct.ac.za> wrote:
> Hi All,
>
> There are a number of call in the DAO layer (*FacadeQueries), that retrieve
> an ibject by id by calling:
>
> getHibernateTemplate().load(
>
> as a result if an unknownid is passed an unchecked
> org.hibernate.ObjectNotFoundException is thrown that escalates to the portal
> error handler. Now I'm not sure but it would seem that
>
> getHibernateTemplate().get(
>
> is more inline with the expected behaviour as it returns null rather than an
> error. Am I correct in this?
>
> Regards
>
> David
>
>
> ________________________________
> UNIVERSITY OF CAPE TOWN
>
> This e-mail is subject to the UCT ICT policies and e-mail disclaimer
> published on our website at
> http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27
> 21 650 9111. This e-mail is intended only for the person(s) to whom it is
> addressed. If the e-mail has reached you in error, please notify the author.
> If you are not the intended recipient of the e-mail you may not use,
> disclose, copy, redirect or print the content. If this e-mail is not related
> to the business of UCT it is sent by the sender in the sender's individual
> capacity.
>
>
> _______________________________________________
> samigo-team mailing list
> samigo-team at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/samigo-team
>



-- 
Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile


More information about the samigo-team mailing list