Emmanuel, I understand that would be the ideal. However, even there the Session-local setting works. You'd just set the Cache Mode prior to calling multiLoad and then reset it afterwards. So the question is how worthwhile the separate CacheMode per multiLoad call versus cluttering the API
Ah of course, I missed that. Though I like your IdentifierLoadAccess enhancement proposal, an alternative is to use lambas to split what setting one wants from the actual operation. I don't think it's better but that could be explored. Something like
session.doWithOptions( options -> options.setCacheMode() ..., session -> //some session calls ); This would essentially set the options before, do the session operations and unset the options after the operations are done.
Not sure what's more readable / scalable - in number of options.
|