incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r446748 - in /incubator/adffaces/trunk/trinidad/trinidad-api/src/main: java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java java/org/apache/myfaces/trinidad/component/UIXCollection.java
Date Fri, 15 Sep 2006 21:50:05 GMT
Author: awiner
Date: Fri Sep 15 14:50:04 2006
New Revision: 446748

URL: http://svn.apache.org/viewvc?view=rev&rev=446748
Log:
Check in patch for ADFFACES-176:  UIXCollection token cache - Intenal Oracle Bugfix Needs
to be backported to Trinidad.  The problem in the original code was that clearing the token
cache on every encode was too aggressive, especially in the face of PPR requests that don't
update the table (and therefore leave all the IDs in the content as they were).  So, instead,
clear the token cache only on requests where we're delivering a RowChangeEvent.  This itself
isn't perfect, but it's a big improvement.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java?view=diff&rev=446748&r1=446747&r2=446748
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
Fri Sep 15 14:50:04 2006
@@ -98,7 +98,9 @@
         //pu: Implicitly record a Change for 'showAll' attribute
         addAttributeChange("showAll", Boolean.FALSE);
       }
-
+      // since the range is now different we can clear the currency cache:
+      clearCurrencyStringCache();
+      
       __broadcast(event, getRangeChangeListener());
     }
     else if (event instanceof RowDisclosureEvent)

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java?view=diff&rev=446748&r1=446747&r2=446748
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
Fri Sep 15 14:50:04 2006
@@ -441,6 +441,16 @@
   }
 
   /**
+   * Clear the rowKey-to-currencyString cache.
+   * The cache is not cleared immediately; instead it will be cleared
+   * when {@link #encodeBegin} is called.
+   */
+  protected void clearCurrencyStringCache()
+  {
+    _getInternalState(true)._clearTokenCache = true;
+  }
+
+  /**
    * Clears all the currency strings.
    */
   @Override
@@ -448,7 +458,14 @@
   {
     _init();
 
-    _getCurrencyCache().clear();
+    InternalState istate = _getInternalState(true);
+    // we must not clear the currency cache everytime. only clear
+    // it in response to specific events: bug 4773659
+    if (istate._clearTokenCache)
+    {
+      istate._clearTokenCache = false;
+      _getCurrencyCache().clear();
+    }
     _flushCachedModel();
 
     Object assertKey = null;
@@ -1165,6 +1182,7 @@
     private transient Object _value = null;
     private transient CollectionModel _model = null;
     private transient Object _currentRowKey = _NULL;
+    private transient boolean _clearTokenCache = false;
     // this is true if this is the first request for this viewID and processDecodes
     // was not called:
     private transient boolean _isFirstRender = true;



Mime
View raw message