On Thu, Apr 14, 2011 at 3:51 PM, Iain Reddick <iain.redd...@beatsystems.com>wrote:
> Firstly, that LDM code is broken - calling detach() on load() makes no > sense. > Right - you should *not* call detach from within load(). > Also, it will hit hibernate on every call to getObject(), as you aren't > caching the loaded Parent entity. This is probably the cause of the > hibernate exceptions you are seeing. > Wrong - LDM caches the returned object within it. That's the whole point of LDM. > Check out http://wicketinaction.com/2008/09/building-a-smart-entitymodel/for > a solid persistence backed LDM implementation. > > Unrelated, your ParentsService.load() method probably doesn't need to take > the entity class a parameter - the service should know the entity type it is > querying hibernate for. > -- Jeremy Thomerson http://wickettraining.com *Need a CMS for Wicket? Use Brix! http://brixcms.org*