openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-1532) Should the <shared-cache-mode> element in a persistence unit definition automatically turn on the data cache?
Date Thu, 25 Feb 2010 14:39:28 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Dick updated OPENJPA-1532:
----------------------------------

    Attachment: OPENJPA-1532.patch.txt

Attaching a patch which partially resolves this issue. I wouldn't consider it finished though.


Specifically the patch sets openjpa.DataCache and openjpa.RemoteCommitProvider to the most
basic values if :
1. They are not already provided in persistence.xml or passed in when the EMF is created
2. shared-cache-mode is not NONE

There's still work to be done to resolve conflicts, (eg shared-cache-mode = ALL and openjpa.DataCache=false),
and there may be a cleaner way to handle the properties, but at least it's a starting point.


> Should the <shared-cache-mode> element in a persistence unit definition automatically
turn on the data cache?
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1532
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1532
>             Project: OpenJPA
>          Issue Type: Question
>          Components: datacache
>    Affects Versions: 2.0.0-M1, 2.0.0-M2, 2.0.0-M3, 2.0.0-beta, 2.0.0, 2.0.1, 2.1.0
>            Reporter: Jody Grassel
>            Assignee: Michael Dick
>            Priority: Minor
>         Attachments: OPENJPA-1532.patch.txt
>
>
> The JPA 2.0 spec introduces a new persistence unit definition element, <shared-cache-mode>,
which accepts NONE, ALL, ENABLE_SELECTIVE, and DISABLE_SELECTIVE.  The JPA 2.0 spec section
3.7.1 documents the behavior of each of those modes.
> What I am curious about is if the use of <shared-cache-mode> should implicitly
enable OpenJPA's data cache plugin.  Currently, the above element is completely ignored if
the persistence unit is missing the properties: openjpa.DataCache=true and openjpa.RemoteCommitProvider=sjvm
(because by default, OpenJPA disables data caching).  My interpretation of the spec suggests
that <shared-cache-mode> is not only a platform-independent method of instructing the
data cache which entities are eligible for admittance to the data cache, but it is also a
switch providing a platform-independent method of both turning the data cache on or off (since
whether the cache is enabled by default is platform-specific).  Otherwise, why have a NONE
value, if it was not intended to be a platform independent means of turning the data cache
off?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message