summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-01-02 14:14:36 +0000
committerVaadin Code Review <review@vaadin.com>2013-01-02 14:14:36 +0000
commitc26049ddd233f32f705cd8769a127facba66aa8c (patch)
treea14558c9d3e4c104633bed1096ecdcb03d73b7d5
parent21b8e3652e816dd499338d74ec8a9f7f903b8913 (diff)
parent395dad4cd7a854314e42dca2eb9dd2879ba53de8 (diff)
downloadvaadin-framework-c26049ddd233f32f705cd8769a127facba66aa8c.tar.gz
vaadin-framework-c26049ddd233f32f705cd8769a127facba66aa8c.zip
Merge "Merge of (#9529) to Vaadin 7."
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
index 12cb892090..065810a7b4 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
@@ -854,7 +854,21 @@ public class SQLContainer implements Container, Container.Filterable,
* Does NOT remove sorting or filtering rules!
*/
public void refresh() {
- sizeDirty = true;
+ refresh(true);
+ }
+
+ /**
+ * Refreshes the container. If <code>setSizeDirty</code> is
+ * <code>false</code>, assumes that the current size is up to date. This is
+ * used in {@link #updateCount()} to refresh the contents when we know the
+ * size was just updated.
+ *
+ * @param setSizeDirty
+ */
+ private void refresh(boolean setSizeDirty) {
+ if (setSizeDirty) {
+ sizeDirty = true;
+ }
currentOffset = 0;
cachedItems.clear();
itemIndexes.clear();
@@ -1105,12 +1119,13 @@ public class SQLContainer implements Container, Container.Filterable,
"The query delegate doesn't support filtering", e);
}
int newSize = delegate.getCount();
+ sizeUpdated = new Date();
+ sizeDirty = false;
if (newSize != size) {
size = newSize;
- refresh();
+ // Size is up to date so don't set it back to dirty in refresh()
+ refresh(false);
}
- sizeUpdated = new Date();
- sizeDirty = false;
getLogger().log(Level.FINER,
"Updated row count. New count is: " + size);
} catch (SQLException e) {