You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2012/09/17 21:26:07 UTC

[jira] [Assigned] (OPENJPA-1532) Should the element in a persistence unit definition automatically turn on the data cache?

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

Rick Curtis reassigned OPENJPA-1532:
------------------------------------

    Assignee: Rick Curtis  (was: Michael Dick)
    
> 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: Rick Curtis
>            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.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Assigned] (OPENJPA-1532) Should the element in a persistence unit definition automatically turn on the data cache?

Posted by Kevin Sutter <kw...@gmail.com>.
Please post these type of discussions directly to the OPENJPA-1532 JIRA so
that we have the history where it's needed.

I have already voiced my view in the JIRA -- the JPA 2 configuration
<shared-cache-mode> should direct our internal property settings.  Much
like we did with the javax.persistence.* properties for the datasource.  We
didn't tell users to re-define their requests via the openjpa.Connection*
properties.  Sure, we have some "merging" conflicts to detect and report
and act on, but these are not insurmountable.  I've had several discussions
with customers that ask why <shared-cache-mode> doesn't enable the data
cache.  Unless someone can show in the spec where this should not control
the cache, I'm in favor of having it control our datacache support.

I think section 3.7.1 is pretty clear on the intent of enablement or
disablement of the cache based on this property.

Kevin

On Fri, Sep 21, 2012 at 2:29 PM, Rick Curtis <cu...@gmail.com> wrote:

> >  It would lead to complications.
> What other complications are you concerned with?
>
> I don't like the fact that to use the JPA2 way of caching requires two
> properties to enable caching.
>
> On Thu, Sep 20, 2012 at 7:23 PM, Pinaki Poddar <pp...@apache.org> wrote:
>
> > Rick,
> >   Having one configuration impacting another is not recommendable. It
> would
> > lead to complications.
> > I am not arguing about rationale of active DataCache for
> > <shared-data-cache>
> > -- but would refrain to do it *automatically* in code.
> > At code level, better would be to simply warn
> > "you have <shared-cache> but your data cache is not active. This
> directive
> > will be ignored unless you ..."
> >
> > The issue should be handled at documentation level: "if you are using
> > <shared-data-cache>, you *must* activate data cache by
> > openjpa.DataCache=true etc.".
> >
> >
> >
> >
> >
> >
> >
> > -----
> > Pinaki Poddar
> > Chair, Apache OpenJPA Project
> >
> > --
> *Rick Curtis*
>

Re: [jira] [Assigned] (OPENJPA-1532) Should the element in a persistence unit definition automatically turn on the data cache?

Posted by Rick Curtis <cu...@gmail.com>.
>  It would lead to complications.
What other complications are you concerned with?

I don't like the fact that to use the JPA2 way of caching requires two
properties to enable caching.

On Thu, Sep 20, 2012 at 7:23 PM, Pinaki Poddar <pp...@apache.org> wrote:

> Rick,
>   Having one configuration impacting another is not recommendable. It would
> lead to complications.
> I am not arguing about rationale of active DataCache for
> <shared-data-cache>
> -- but would refrain to do it *automatically* in code.
> At code level, better would be to simply warn
> "you have <shared-cache> but your data cache is not active. This directive
> will be ignored unless you ..."
>
> The issue should be handled at documentation level: "if you are using
> <shared-data-cache>, you *must* activate data cache by
> openjpa.DataCache=true etc.".
>
>
>
>
>
>
>
> -----
> Pinaki Poddar
> Chair, Apache OpenJPA Project
>
> --
*Rick Curtis*

Re: [jira] [Assigned] (OPENJPA-1532) Should the element in a persistence unit definition automatically turn on the data cache?

Posted by Pinaki Poddar <pp...@apache.org>.
Rick,
  Having one configuration impacting another is not recommendable. It would
lead to complications. 
I am not arguing about rationale of active DataCache for <shared-data-cache>
-- but would refrain to do it *automatically* in code.
At code level, better would be to simply warn 
"you have <shared-cache> but your data cache is not active. This directive
will be ignored unless you ..."

The issue should be handled at documentation level: "if you are using
<shared-data-cache>, you *must* activate data cache by
openjpa.DataCache=true etc.".







-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: http://openjpa.208410.n2.nabble.com/jira-Assigned-OPENJPA-1532-Should-the-shared-cache-mode-element-in-a-persistence-unit-definition-aut-tp7581118p7581158.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.