Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE79F10D65 for ; Tue, 29 Oct 2013 18:11:21 +0000 (UTC) Received: (qmail 48542 invoked by uid 500); 29 Oct 2013 18:11:21 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 48500 invoked by uid 500); 29 Oct 2013 18:11:21 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 48492 invoked by uid 99); 29 Oct 2013 18:11:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 18:11:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fyrewyld@gmail.com designates 209.85.217.182 as permitted sender) Received: from [209.85.217.182] (HELO mail-lb0-f182.google.com) (209.85.217.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Oct 2013 18:11:16 +0000 Received: by mail-lb0-f182.google.com with SMTP id w6so355029lbh.13 for ; Tue, 29 Oct 2013 11:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ULUZ8rgRop6NUpSXksIgIE3kK5u6g8vS4axo3RVWOjE=; b=Uv63BQno8/lBmw5GNRk9xVhbMDRMEMdvSxGWYwmzJFLIYzpXAA6KM22ECXNtMd61lx h+U5KZJHa0Dg9GnK0rpUwnBrMZpmidUWUyarYjco4MxfZqCmaJsmoMpGweIHu9f4i5EH Qd/dgrQeuPfrXMBgl3LJmaPXafhDtmfBaRx3KzQDRJT/vZBJxXPVeKvipCQlHSaxFKyS Vc4uoRKSV0ttB++ICN9Gp83d6xsIRKmc4KljyocYcIc4Uz/LraLl9h+xUZ4Q0avhV+jY HjMwcICYkCecRRi78oKqrI/OKvqM8dDePjX84McF9t6SVTy/A8oDPUyu8z8rah2QrtWo FWBA== MIME-Version: 1.0 X-Received: by 10.152.28.7 with SMTP id x7mr493175lag.26.1383070252526; Tue, 29 Oct 2013 11:10:52 -0700 (PDT) Received: by 10.114.23.69 with HTTP; Tue, 29 Oct 2013 11:10:52 -0700 (PDT) In-Reply-To: <1383069015.16473.YahooMailNeo@web28905.mail.ir2.yahoo.com> References: <20131029162337.8E61C23889EC@eris.apache.org> <1383069015.16473.YahooMailNeo@web28905.mail.ir2.yahoo.com> Date: Tue, 29 Oct 2013 13:10:52 -0500 Message-ID: Subject: Re: svn commit: r1536793 - in /openjpa/branches/2.3.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ From: Jody Grassel To: dev@openjpa.apache.org, Mark Struberg Content-Type: multipart/alternative; boundary=089e0160bf7019efcd04e9e52330 X-Virus-Checked: Checked by ClamAV on apache.org --089e0160bf7019efcd04e9e52330 Content-Type: text/plain; charset=ISO-8859-1 Yes, all fixes for OJ-2414 that went into 2.3.x have been checked into trunk. On Tue, Oct 29, 2013 at 12:50 PM, Mark Struberg wrote: > jody, did you also fix this in trunk? > > I'm assuming that all bugs fixed in 2.3.x also work in and got applied to > trunk > > > txs and LieGrue, > strub > > > > ----- Original Message ----- > > From: "jgrassel@apache.org" > > To: commits@openjpa.apache.org > > Cc: > > Sent: Tuesday, 29 October 2013, 17:23 > > Subject: svn commit: r1536793 - in /openjpa/branches/2.3.x: > openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ > openjpa-kernel/src/main/java/org/apache/openjpa/conf/ > openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ > > > > Author: jgrassel > > Date: Tue Oct 29 16:23:36 2013 > > New Revision: 1536793 > > > > URL: http://svn.apache.org/r1536793 > > Log: > > OPENJPA-2414: FinderCache does not consider active Fetch > Groups/FetchPlan added > > Fields > > > > Modified: > > > > > openjpa/branches/2.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java > > > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java > > > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingFetchConfiguration.java > > > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java > > > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java > > > > Modified: > > > openjpa/branches/2.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java > > URL: > > > http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java?rev=1536793&r1=1536792&r2=1536793&view=diff > > > ============================================================================== > > --- > > > openjpa/branches/2.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java > > (original) > > +++ > > > openjpa/branches/2.3.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java > > Tue Oct 29 16:23:36 2013 > > @@ -109,7 +109,7 @@ public class FinderCacheImpl > > } > > > > // FinderCache only operates with Default Fetch Plans > > - if (!fetch.isDefaultPUFetchGroupConfigurationOnly()) { > > + if (!fetch.isFetchConfigurationSQLCacheAdmissible()) { > > return null; > > } > > > > @@ -152,7 +152,7 @@ public class FinderCacheImpl > > } > > > > // FinderCache only operates with Default Fetch Plans > > - if (!fetch.isDefaultPUFetchGroupConfigurationOnly()) { > > + if (!fetch.isFetchConfigurationSQLCacheAdmissible()) { > > return null; > > } > > > > > > Modified: > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java > > URL: > > > http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java?rev=1536793&r1=1536792&r2=1536793&view=diff > > > ============================================================================== > > --- > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java > > (original) > > +++ > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java > > Tue Oct 29 16:23:36 2013 > > @@ -77,6 +77,7 @@ public class Compatibility { > > private boolean _singletonLifecycleEventManager = false; > > private boolean _filterPCRegistryClasses = false; // OPENJPA-2288 > > private boolean _returnNullOnEmptyAggregateResult = true; // > OPENJPA-1794 > > + private boolean _cacheNonDefaultFetchPlanQueries = false; // > OPENJPA-2414 > > > > /** > > * Whether to require exact identity value types when creating > object > > @@ -763,4 +764,18 @@ public class Compatibility { > > public void setReturnNullOnAggregateResult(boolean > > returnNullOnEmptyAggregateResult) { > > _returnNullOnEmptyAggregateResult = > returnNullOnEmptyAggregateResult; > > } > > + > > + /** > > + * Whether the SQL generated for queries executed with a modified > fetch > > plan are cached. > > + */ > > + public boolean getCacheNonDefaultFetchPlanQueries() { > > + return _cacheNonDefaultFetchPlanQueries; > > + } > > + > > + /** > > + * Whether the SQL generated for queries executed with a modified > fetch > > plan are cached. > > + */ > > + public void setCacheNonDefaultFetchPlanQueries(boolean bool) { > > + _cacheNonDefaultFetchPlanQueries = bool; > > + } > > } > > > > Modified: > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingFetchConfiguration.java > > URL: > > > http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingFetchConfiguration.java?rev=1536793&r1=1536792&r2=1536793&view=diff > > > ============================================================================== > > --- > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingFetchConfiguration.java > > (original) > > +++ > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingFetchConfiguration.java > > Tue Oct 29 16:23:36 2013 > > @@ -595,4 +595,12 @@ public class DelegatingFetchConfiguratio > > throw translate(re); > > } > > } > > + > > + public boolean isFetchConfigurationSQLCacheAdmissible() { > > + try { > > + return _fetch.isFetchConfigurationSQLCacheAdmissible(); > > + } catch (RuntimeException re) { > > + throw translate(re); > > + } > > + } > > } > > > > Modified: > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java > > URL: > > > http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java?rev=1536793&r1=1536792&r2=1536793&view=diff > > > ============================================================================== > > --- > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java > > (original) > > +++ > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java > > Tue Oct 29 16:23:36 2013 > > @@ -474,4 +474,9 @@ public interface FetchConfiguration > > * @since 0.4.1 > > */ > > public FetchConfiguration traverse(FieldMetaData fm); > > + > > + /** > > + * Whether SQL generated by the FetchConfiguration's current > > configuration should be cached. > > + */ > > + public boolean isFetchConfigurationSQLCacheAdmissible(); > > } > > > > Modified: > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java > > URL: > > > http://svn.apache.org/viewvc/openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=1536793&r1=1536792&r2=1536793&view=diff > > > ============================================================================== > > --- > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java > > (original) > > +++ > > > openjpa/branches/2.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java > > Tue Oct 29 16:23:36 2013 > > @@ -148,7 +148,8 @@ public class FetchConfigurationImpl > > public boolean fetchGroupIsPUDefault = false; > > public boolean extendedPathLookup = false; > > public DataCacheRetrieveMode cacheRetrieveMode = > > DataCacheRetrieveMode.USE; > > - public DataCacheStoreMode cacheStoreMode = > DataCacheStoreMode.USE; > > > > + public DataCacheStoreMode cacheStoreMode = > DataCacheStoreMode.USE; > > + public boolean cacheNonDefaultFetchPlanQueries = false; > > } > > > > private final ConfigurationState _state; > > @@ -193,6 +194,8 @@ public class FetchConfigurationImpl > > > > addFetchGroups(Arrays.asList(fetchGroupList)); > > setMaxFetchDepth(conf.getMaxFetchDepth()); > > + > > + _state.cacheNonDefaultFetchPlanQueries = > > conf.getCompatibilityInstance().getCacheNonDefaultFetchPlanQueries(); > > } > > > > /** > > @@ -201,6 +204,7 @@ public class FetchConfigurationImpl > > public Object clone() { > > FetchConfigurationImpl clone = newInstance(null); > > clone._state.ctx = _state.ctx; > > + clone._state.cacheNonDefaultFetchPlanQueries = > > _state.cacheNonDefaultFetchPlanQueries; > > clone._parent = _parent; > > clone._fromField = _fromField; > > clone._fromType = _fromType; > > @@ -346,7 +350,7 @@ public class FetchConfigurationImpl > > return addFetchGroup(name, true); > > } > > > > - public FetchConfiguration addFetchGroup(String name, boolean > > recomputeIsDefault) { > > + private FetchConfiguration addFetchGroup(String name, boolean > > recomputeIsDefault) { > > if (StringUtils.isEmpty(name)) > > throw new UserException(_loc.get("null-fg")); > > > > @@ -383,7 +387,7 @@ public class FetchConfigurationImpl > > return removeFetchGroup(group, true); > > } > > > > - public FetchConfiguration removeFetchGroup(String group, boolean > > recomputeIsDefault) { > > + private FetchConfiguration removeFetchGroup(String group, boolean > > recomputeIsDefault) { > > lock(); > > try { > > if (_state.fetchGroups != null) { > > @@ -482,6 +486,15 @@ public class FetchConfigurationImpl > > public boolean isDefaultPUFetchGroupConfigurationOnly() { > > return _state.fetchGroupIsPUDefault; > > } > > + > > + public boolean isFetchConfigurationSQLCacheAdmissible() { > > + if (_state == null || _state.cacheNonDefaultFetchPlanQueries) { > > + return false; > > + } else { > > + // Only pctx-default matching FetchConfiguration generated > SQL is > > cache permissible > > + return _state.fetchGroupIsPUDefault; > > + } > > + } > > > > public Set getFields() { > > if (_state.fields == null) return Collections.emptySet(); > > @@ -518,6 +531,7 @@ public class FetchConfigurationImpl > > _state.fields = new HashSet(); > > _state.fields.addAll(fields); > > } finally { > > + verifyDefaultPUFetchGroups(); > > unlock(); > > } > > return this; > > > --089e0160bf7019efcd04e9e52330--