Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cache.evict() after persist, or how?

Please include the stack trace.

Bálint Kriván wrote:
> Thanks, will try the getReference() stuff, but when i'm setting @Cache
> annotation shared attribute to false, instead of type=NONE, I'm getting
> strange exceptions:
> "unknown state or association field [myField] of class
> [com.example.MyEntity]"
> but it works with type=NONE
> and:
> "A non-read-only mapping must be defined for the sequence number field."
> So what is this? I'm sure that I'm getting wrong something, but what?
> Thanks
> for guiding me!
> On Wed, Nov 17, 2010 at 3:30 PM, James Sutherland
> <jamesssss@xxxxxxxxx>wrote:
>> Setting the reference is the best way to resolve this.
>> However, it is also possible to have an insert/transaction not update the
>> shared cache.  To do this you just need to call flush() and then clear()
>> before commit().  Then the inserted objects will not be added to the
>> shared
>> cache.  This is sometimes useful for large batch insertions.
>> Also, BTW, to disable the cache set shared=false do not set type=NONE.

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
Blog: Java Persistence
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top