diff --git a/kura/org.eclipse.kura.core/OSGI-INF/metatype/org.eclipse.kura.core.db.H2DbService.xml b/kura/org.eclipse.kura.core/OSGI-INF/metatype/org.eclipse.kura.core.db.H2DbService.xml index 563cc48efa4..a0268e0e94c 100644 --- a/kura/org.eclipse.kura.core/OSGI-INF/metatype/org.eclipse.kura.core.db.H2DbService.xml +++ b/kura/org.eclipse.kura.core/OSGI-INF/metatype/org.eclipse.kura.core.db.H2DbService.xml @@ -70,17 +70,7 @@ default="10" min="1" description="The H2DbService manages connections using a connection pool. This parameter defines the maximum number of connections for the pool"/> - - - diff --git a/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceImpl.java b/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceImpl.java index 644a52f9b21..a80e403bba7 100644 --- a/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceImpl.java +++ b/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceImpl.java @@ -448,7 +448,7 @@ private void openConnectionPool(H2DbServiceOptions configuration, String passwor this.dataSource = new JdbcDataSource(); - this.dataSource.setURL(withMaxCompactTime(configuration.getMaxCompactTime(), configuration.getDbUrl())); + this.dataSource.setURL(configuration.getDbUrl()); this.dataSource.setUser(configuration.getUser()); this.dataSource.setPassword(password); @@ -457,10 +457,6 @@ private void openConnectionPool(H2DbServiceOptions configuration, String passwor openDatabase(configuration, true); } - private String withMaxCompactTime(Integer maxCompactTime, String dbUrl) { - return dbUrl.concat(";MAX_COMPACT_TIME=").concat(maxCompactTime.toString()); - } - private void openDatabase(H2DbServiceOptions configuration, boolean deleteDbOnError) { Connection conn = null; try { @@ -578,7 +574,7 @@ private void shutdownDefrag() throws SQLException { try { conn = H2DbServiceImpl.this.dataSource.getConnection(); stmt = conn.createStatement(); - stmt.execute("SHUTDOWN"); + stmt.execute("SHUTDOWN DEFRAG"); } finally { close(stmt); close(conn); diff --git a/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceOptions.java b/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceOptions.java index 932ba553b11..199985ae42d 100644 --- a/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceOptions.java +++ b/kura/org.eclipse.kura.core/src/main/java/org/eclipse/kura/core/db/H2DbServiceOptions.java @@ -27,12 +27,10 @@ class H2DbServiceOptions { private static final Property DEFRAG_INTERVAL_MINUTES_PROP = new Property<>("db.defrag.interval.minutes", 20); private static final Property CONNECTION_POOL_MAX_SIZE = new Property<>("db.connection.pool.max.size", 10); - private static final Property MAX_COMPACT_TIME = new Property<>("db.max.compact.time", 120000); private static final Pattern FILE_LOG_LEVEL_PATTERN = generatePatternForProperty("trace_level_file"); private static final Pattern USER_PATTERN = generatePatternForProperty("user"); private static final Pattern PASSWORD_PATTERN = generatePatternForProperty("password"); - private static final Pattern MAX_COMPACT_TIME_PATTERN = generatePatternForProperty("max_compact_time"); private static final Pattern JDBC_URL_PARSE_PATTERN = Pattern.compile("jdbc:([^:]+):(([^:]+):)?([^;]*)(;.*)?"); @@ -42,7 +40,6 @@ class H2DbServiceOptions { private final long checkpointIntervalSeconds; private final long defragIntervalMinutes; private final int maxConnectionPoolSize; - private final int maxCompactTime; private boolean isInMemory; private boolean isFileBased; @@ -60,13 +57,11 @@ public H2DbServiceOptions(Map properties) { this.checkpointIntervalSeconds = CHECKPOINT_INTERVAL_SECONDS_PROP.get(properties); this.defragIntervalMinutes = DEFRAG_INTERVAL_MINUTES_PROP.get(properties); this.maxConnectionPoolSize = CONNECTION_POOL_MAX_SIZE.get(properties); - this.maxCompactTime = MAX_COMPACT_TIME.get(properties); String dbUrlProp = CONNECTOR_URL_PROP.get(properties); dbUrlProp = USER_PATTERN.matcher(dbUrlProp).replaceAll(""); dbUrlProp = PASSWORD_PATTERN.matcher(dbUrlProp).replaceAll(""); - dbUrlProp = MAX_COMPACT_TIME_PATTERN.matcher(dbUrlProp).replaceAll(""); this.dbUrl = dbUrlProp; computeUrlParts(); @@ -187,10 +182,6 @@ public int getConnectionPoolMaxSize() { return this.maxConnectionPoolSize; } - public int getMaxCompactTime() { - return maxCompactTime; - } - public boolean isFileBasedLogLevelSpecified() { return this.isFileBasedLogLevelSpecified; } diff --git a/target-platform/p2-repo-equinox_3.16.0/pom.xml b/target-platform/p2-repo-equinox_3.16.0/pom.xml index 94cac2729b8..1d60da059da 100644 --- a/target-platform/p2-repo-equinox_3.16.0/pom.xml +++ b/target-platform/p2-repo-equinox_3.16.0/pom.xml @@ -152,7 +152,9 @@ - +