Shervin Asgari wrote on Oct 26, 2010 04:47:
To circumvent this I have manually cached the list in the session context in the @Create method and return the list.
What I meant to say is that I check the session context in the unwrap method, not @Create
It can event get uglier when you have a ajax-poll on your page. The unwrap is called over and over again. I think this is a JSF-problem which can't be solvd easily. I'm using a two layer approach where the unwrap is used to get things (from the DB or cahche) and a factory to provide them to the visual layer. Its called the same ridiculous number of times, but it's more efficient/faster.
I asked on irc, and it seems I had misunderstood the Unwrap.
It seems like Unwrap is used to when it is useful if you want to perform an action before the object is accessed. e.g. the SMPC uses @Unwrap to make sure it has joined the transaction every time.
Seems like it is Factory that suits my needs, which outjects the result to the specified scope