Yes, we assume that the objects won't be in the first or second level cache by default and we go for an explicit (Criteria) query to load the interesting objects.
The user has options to tell us that either the data is in majority in the PC or in the 2nd LC.
I think we went for that explicit road because we might try to load objects that are no longer in the database. In this case, a 2nd LC + a DB lookup is a double penalty. It is a fairly hard to configure ergonomics so we can definitely revisit its usefulness.
|