There's no documentation for the evict method, and I agree that it seems logical for it to evict an entity from the L1 cache. The only reference in the docs is that it can optionally evict from the L2 cache (data cache) in addition to whatever else it does.
What it actually does is reset internal state. I'm not sure of a good way to evict a single entity from the L1 cache in OpenJPA 1.2. In later versions you can call em.detach(obj), but in v1.2 that will just detach a copy. Or you can call clear() to remove everything from the L1 cache which is a bit extreme. Presumably your code executes a find later on and you want to prevent reading a stale row? A JPQL query will execute against the database so the results there should be up to date. -mike On Mon, Feb 7, 2011 at 7:34 AM, Daryl Stultz <[email protected]>wrote: > On Fri, Feb 4, 2011 at 3:42 PM, Daryl Stultz <[email protected] > >wrote: > > > Hello, > > > > > > Before, em contains case: true detached: false > > After evict, em contains case: true detached: false > > After delete, em contains case: true detached: false > > > > > > Am I not understanding how this should work? I am not using L2 cache, > > > > Hmm, does nobody do any evicting or detaching? Anyone know how it's > supposed > to work? > > Thanks. > > -- > Daryl Stultz > _____________________________________ > 6 Degrees Software and Consulting, Inc. > http://www.6degrees.com > http://www.opentempo.com > mailto:[email protected] >
