Note btw that 40 individual selects might not allways be less efficient. If you are using a caching mechanism, issiung a query would probably be circumventing it. This is at least true for older Hibernate versions, where you can better use the .iterate() method (which first selects the id's and then the individual rows) instead of the .list() method (which queries right away without checking any cache).

Also, currently the model is allready only attach when needed. Attachement happens on the first getObject, and onAttach is called at most once during a request.

Eelco

Cameron Braid wrote:

The issue that I think will eventuate from this is perforamce related.

If I have a list of 40 items each using a detachable model (based on entity id). When the request comes back (after a post) there will need to be 40 individual selects to re-attach the listitem models.

This is because detachable models seem to be automatically re-attachd automatically at the start of the request - even if the model isn’t accessed.

Would it be possible to have a lazy detachable model, such that it is only re-attached if / when the model is actually accessed ?

Cameron




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to