Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2014-12-09 15:58:05 +0000
committerDawid Pakuła2014-12-10 14:46:53 +0000
commit61f239548061d84597932ef759ac9a50b5e5c3ee (patch)
treea019bbc0820dc594ed57a55aadd006415814df00
parentf3146d04518352885914a4604f224146195afda9 (diff)
downloadorg.eclipse.dltk.core-61f239548061d84597932ef759ac9a50b5e5c3ee.tar.gz
org.eclipse.dltk.core-61f239548061d84597932ef759ac9a50b5e5c3ee.tar.xz
org.eclipse.dltk.core-61f239548061d84597932ef759ac9a50b5e5c3ee.zip
Bug 454597 - Improve H2 connection setttings
Change-Id: I05cb48c514e59b1d05d796a96a37f7b90e9528e0 Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/core/index/sql/h2/H2IndexPreferences.java20
-rw-r--r--core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/internal/core/index/sql/h2/H2DbFactory.java11
2 files changed, 31 insertions, 0 deletions
diff --git a/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/core/index/sql/h2/H2IndexPreferences.java b/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/core/index/sql/h2/H2IndexPreferences.java
index 841cf1c7e..227921e19 100644
--- a/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/core/index/sql/h2/H2IndexPreferences.java
+++ b/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/core/index/sql/h2/H2IndexPreferences.java
@@ -39,6 +39,24 @@ public class H2IndexPreferences extends AbstractPreferenceInitializer {
public static final String DB_LOCK_MODE = "lockMode"; //$NON-NLS-1$
/**
+ * H2 Database query cache size
+ *
+ * @see http://www.h2database.com/javadoc/org/h2/constant/DbSettings.html#
+ * DB_QUERY_CACHE_SIZE
+ * @since 5.1.1
+ */
+ public static final String DB_QUERY_CACHE_SIZE = "queryCacheSize"; //$NON-NLS-1$
+
+ /**
+ * H2 Database large result buffer size
+ *
+ * @see http://www.h2database.com/javadoc/org/h2/constant/DbSettings.html#
+ * DB_LARGE_RESULT_BUFFER_SIZE
+ * @since 5.1.1
+ */
+ public static final String DB_LARGE_RESULT_BUFFER_SIZE = "largeResultBufferSize"; //$NON-NLS-1$
+
+ /**
* Schema version
*/
public static final String SCHEMA_VERSION = "schemaVersion"; //$NON-NLS-1$
@@ -51,5 +69,7 @@ public class H2IndexPreferences extends AbstractPreferenceInitializer {
p.putInt(DB_CACHE_SIZE, 32000); // 32Mb
p.put(DB_CACHE_TYPE, "LRU");
p.putInt(DB_LOCK_MODE, 0); // no transaction isolation
+ p.putInt(DB_QUERY_CACHE_SIZE, 32); // last 32 statements
+ p.putInt(DB_LARGE_RESULT_BUFFER_SIZE, 16384); // x4 default value
}
}
diff --git a/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/internal/core/index/sql/h2/H2DbFactory.java b/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/internal/core/index/sql/h2/H2DbFactory.java
index 3453d9e86..e150490e7 100644
--- a/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/internal/core/index/sql/h2/H2DbFactory.java
+++ b/core/plugins/org.eclipse.dltk.core.index.sql.h2/src/org/eclipse/dltk/internal/core/index/sql/h2/H2DbFactory.java
@@ -150,6 +150,17 @@ public class H2DbFactory extends DbFactory {
preferencesService.getInt(H2Index.PLUGIN_ID,
H2IndexPreferences.DB_CACHE_SIZE, 0, null));
+ buf.append(";QUERY_CACHE_SIZE=").append(
+ preferencesService.getInt(H2Index.PLUGIN_ID,
+ H2IndexPreferences.DB_QUERY_CACHE_SIZE, 0, null));
+
+ buf.append(";LARGE_RESULT_BUFFER_SIZE=").append(
+ preferencesService
+ .getInt(H2Index.PLUGIN_ID,
+ H2IndexPreferences.DB_LARGE_RESULT_BUFFER_SIZE,
+ 0, null));
+ buf.append(";FILE_LOCK=NO");
+
return buf.toString();
}

Back to the top