Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Turned on JPA caching, now get weird errors resolving @OneToMany

ENABLE_SELECTIVE means enable caching when the annotation is present, and
disable caching for all entities where it is not.  So you get some entities
using caching and others not.

Can you try enabling caching for all entities (not this is the default, so
you may have been caching before if you were not setting anything), and
disabling caching for all entities.  Do these work?

Your issue seems to be the same as the bug.  Please add your exception and
info to the bug and vote for it.

My guess is that this issue is related to our new "protected" cache support
added in 2.2, this is used when you mix caching and non-caching in related
objects.  Do you have objects that are cached with references to objects
that are not cached?  If you remove these (cache both or neither), do you
still get the issue?

The other possibility is that it is a case issue, probably with a native
query, ensure your case is correct.

If you could put a breakpoint in the error and inspect the contents of the
row in a debugger this would be helpful.



ljnelson wrote:
> 
> Now I'm reading that selective caching is on by default throughout
> EclipseLink:
> http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/cache_usaged#Section_3.7.1_-_The_shared-cache-mode_element
> 
> So it would seem that the
> <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> should be a no-op.
> 
> And if it's a no-op, then I'm not sure how it would trigger this bug.
> 
> L
> 
> On Wed, Mar 16, 2011 at 2:06 PM, Laird Nelson <ljnelson@xxxxxxxxx> wrote:
> 
>> On Wed, Mar 16, 2011 at 1:55 PM, Laird Nelson <ljnelson@xxxxxxxxx> wrote:
>>
>>> I finally got around to implementing caching.  I annotated certain
>>> entities with the @Cacheable(true) annotation, and put this in my
>>> persistence.xml:
>>>
>>> <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
>>>
>>
>> I see that others have had this problem:
>> http://www.eclipse.org/forums/index.php?t=tree&th=205504&S=ddabf812109c76ae6c9b186010d70a2c#page_top
>>
>> That post mentions https://bugs.eclipse.org/bugs/show_bug.cgi?id=337422.
>>
>> The version report in there is incorrect; Glassfish uses 2.2.0.
>>
>> I hope someone can tell me what a workaround might be; I need selective
>> caching.
>>
>> Best,
>> Laird
>>
>>
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Turned-on-JPA-caching%2C-now-get-weird-errors-resolving-%40OneToMany-tp31165953p31229638.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top