TopLink Wiki
Main
RecentChanges
Set your name in
UserPreferences
Referenced by
JSPWiki v2.0.52
|
I need to refresh an object -- I know it's changed
NoteReadAllQueries always go to the database. This therefore applies to ReadObjectQueries only.
Solution A: Refresh the ObjectIf you already have the object around, it's easiest to just refresh it. See Session.refreshObject. This is strictly equivalent to creating a ReadObjectQuery and cascading the refresh to private parts.
Solution B: Refreshing QueryYou have to decide whether you want to refresh the object's attributes as well. Set whether to cascade the refresh to nothing, to the object's private parts, or to the object's private and public parts. ReadObjectQuery.refreshIdentityMapResult ReadObjectQuery.cascadePrivateParts query.refreshIdentityMapResult();
Note that a primary key hit will never go to the database unless explicitely required to do so, which is what we're doing here.
|
||||||