propsH2 = new Hashtable<>();
-
- propsH2.put(DATASOURCE_PROPERTY_IDENTIFIER, UUID.randomUUID().toString());
- propsH2.put(DATASOURCE_PROPERTY_PLUGABLE_FILESYSTEM, OPTION_PLUGABLE_FILESYSTEM_MEM_FS);
- // Without this, H2 discards the in-memory database as soon as the last connection
- // closes - the CSV importer finishes, closes, and the pool later opens a fresh empty
- // database of the same name. -1 keeps it for the lifetime of the JVM.
- propsH2.put(org.eclipse.daanse.jdbc.datasource.h2.api.Constants
- .DATASOURCE_PROPERTY_DB_CLOSE_DELAY, "-1");
- propsH2.put(KEY_FILE_CONTEXT_MATCHER, matcherKey);
- configH2.update(propsH2);
+ /**
+ * The in-memory database this catalog folder is loaded into: DuckDB.
+ *
+ * Not a choice any more. Measured on FoodMart in this repository, against H2 as
+ * the deployment it replaced: a crossjoin answered in 0.06 s where H2 took
+ * 1077 s, and the catalog's CSV files read in 0.67 s where row-by-row inserts
+ * needed 3.2 minutes.
+ */
+ private void createDataSource(Path path, String matcherKey) throws IOException {
+ Configuration config = ca.getFactoryConfiguration(PID_DATASOURCE, UUID.randomUUID().toString(), "?");
+ Dictionary props = new Hashtable<>();
+ // In memory. The DataSource keeps the connection that owns the database and hands
+ // out duplicates of it, which is what makes one in-memory database reachable from
+ // the importer and the pool alike.
+ props.put(DATASOURCE_PROPERTY_DATABASENAME, ":memory:");
+ props.put(DATASOURCE_PROPERTY_SETTINGS, new String[] { "threads=4" });
+ props.put(KEY_FILE_CONTEXT_MATCHER, matcherKey);
+ config.update(props);
- catalogFolderConfigsDS.put(path, configH2);
+ catalogFolderConfigsDS.put(path, config);
}
/**
diff --git a/application/probe/start b/application/probe/start
index 65de53f..9e29bea 100755
--- a/application/probe/start
+++ b/application/probe/start
@@ -1,23 +1,19 @@
+#!/bin/sh
-# Path to Java-Binary
-JAVA_EXEC="java"
-
-# Logback-Konfiguration
+JAVA_EXEC="${JAVA_HOME:+$JAVA_HOME/bin/}java"
LOGBACK_CONFIG="./logback.xml"
-# Check if java -version returns output successfully
-if ! "$JAVA_EXEC" -version >/dev/null 2>&1; then
- echo "Java is installed but not working properly (java -version failed)."
+# The bundles declare osgi.ee=JavaSE-25; on an older JVM nothing resolves.
+JAVA_MAJOR="$("$JAVA_EXEC" -version 2>&1 | awk -F'"' '/version/ { split($2, v, /[._]/); print (v[1] == "1" ? v[2] : v[1]); exit }')"
+if [ "${JAVA_MAJOR:-0}" -lt 25 ]; then
+ echo "Java 25 is required, but $JAVA_EXEC is Java ${JAVA_MAJOR:-unknown}. Point JAVA_HOME at a Java 25 installation."
exit 1
fi
-
-if [[ ! -f "$LOGBACK_CONFIG" ]]; then
+if [ ! -f "$LOGBACK_CONFIG" ]; then
echo "Logback-Configuration-File $LOGBACK_CONFIG not found."
exit 1
fi
-# start Server
echo "start Server"
"$JAVA_EXEC" -Dlogback.configurationFile=file:"$LOGBACK_CONFIG" -jar daanse.probe.jar
-
diff --git a/application/probe/start.bat b/application/probe/start.bat
index 9c6cddb..c6a5717 100644
--- a/application/probe/start.bat
+++ b/application/probe/start.bat
@@ -2,12 +2,16 @@
setlocal
REM Path to Java-Binary
-set "JAVA_EXEC=java"
+if defined JAVA_HOME (set "JAVA_EXEC=%JAVA_HOME%\bin\java") else (set "JAVA_EXEC=java")
+
+REM The bundles declare osgi.ee=JavaSE-25. An older JVM starts the framework and
+REM opens the HTTP port anyway, leaves most bundles unresolved, and then serves
+REM nothing - so check here rather than debug that.
+set "REQUIRED_JAVA=25"
REM Logback-Configuration-File
set "LOGBACK_CONFIG=.\logback.xml"
-
REM Check if java -version works
"%JAVA_EXEC%" -version >nul 2>&1
if errorlevel 1 (
@@ -15,6 +19,21 @@ if errorlevel 1 (
exit /b 1
)
+REM "25.0.4" -^> 25, and the old "1.8.0_402" -^> 8.
+for /f tokens^=2^ delims^=^" %%v in ('"%JAVA_EXEC%" -version 2^>^&1 ^| findstr /i "version"') do (
+ for /f "tokens=1,2 delims=._" %%a in ("%%v") do (
+ if "%%a"=="1" (set "JAVA_MAJOR=%%b") else (set "JAVA_MAJOR=%%a")
+ )
+ goto :checked
+)
+:checked
+
+if %JAVA_MAJOR% LSS %REQUIRED_JAVA% (
+ echo "Java %REQUIRED_JAVA% is required, but %JAVA_EXEC% is Java %JAVA_MAJOR%."
+ echo "Point JAVA_HOME at a Java %REQUIRED_JAVA% installation."
+ exit /b 1
+)
+
REM Check Logback configuration file exists
if not exist "%LOGBACK_CONFIG%" (
echo "Logback configuration file "%LOGBACK_CONFIG%" not found."