Unverified Commit a7cf51e4 authored by Fabien Viale's avatar Fabien Viale Committed by GitHub
Browse files

Merge pull request #21 from ow2-proactive/master

synchronize fork
parents 3b3de1bf b67f2c8d
# Database connection settings.
# To change the database provider, change the driver (hibernate.connection.driver_class),
# the URL (hibernate.connection.url), and don't forget the dialect (hibernate.dialect)
hibernate.connection.driver_class=org.hsqldb.jdbc.JDBCDriver
hibernate.connection.url=jdbc:hsqldb:hsql://localhost:9001/pca
hibernate.dialect=org.hibernate.dialect.HSQLDialect
# Username and password
hibernate.connection.username=pca
hibernate.connection.password=
# The classname of a custom org.hibernate.connection.ConnectionProvider which provides JDBC connections to Hibernate
hibernate.connection.provider_class=org.hibernate.hikaricp.internal.HikariCPConnectionProvider
# JDBC connection pool configuration
# https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
hibernate.hikari.connectionTimeout=60000
hibernate.hikari.maximumPoolSize=20
hibernate.hikari.transactionIsolation=TRANSACTION_READ_COMMITTED
hibernate.hikari.poolName=pca
# Enable Hibernate's automatic session context management
hibernate.current_session_context_class=thread
# Disable the second-level cache
hibernate.cache.use_second_level_cache=false
# Echo all executed SQL to stdout
hibernate.show_sql=false
# Behavior of the database schema on startup : validate | update | create | create-drop
hibernate.hbm2ddl.auto=update
# Use stream method for binary object: use to store bigger object
hibernate.jdbc.use_streams_for_binary=true
......@@ -54,6 +54,8 @@ public class SchedulerHsqldbStarter {
private Path hibernateCatalogConfiguration;
private Path hibernatePcaConfiguration;
public SchedulerHsqldbStarter() throws IOException {
this.hsqldbServer = createHsqldbServer();
configureCatalogs(hsqldbServer, schedulerHome);
......@@ -102,10 +104,13 @@ public class SchedulerHsqldbStarter {
"catalog",
databaseFileName);
hibernatePcaConfiguration = Paths.get(schedulerHome, schedulerConfigurationFolderName, "pca", databaseFileName);
server.addCatalog(schedulerDbPath, hibernateRmConfiguration);
server.addCatalog(schedulerDbPath, hibernateSchedulerConfiguration);
server.addCatalog(schedulerDbPath, hibernateNotificationServiceConfiguration);
server.addCatalog(schedulerDbPath, hibernateCatalogConfiguration);
server.addCatalog(schedulerDbPath, hibernatePcaConfiguration);
}
public boolean isServerModeRequired() throws IOException {
......
......@@ -59,11 +59,11 @@ public class SchedulerHsqldbStarterTest extends ProActiveTestClean {
@Test
public void testConfigureCatalogs() throws Exception {
verify(hsqldbServerMock, times(4)).addCatalog(Mockito.<Path> any(), Mockito.<Path> any());
verify(hsqldbServerMock, times(5)).addCatalog(Mockito.<Path> any(), Mockito.<Path> any());
schedulerHsqldbStarter.configureCatalogs(hsqldbServerMock, "/scheduler/home/");
verify(hsqldbServerMock, times(8)).addCatalog(Mockito.<Path> any(), Mockito.<Path> any());
verify(hsqldbServerMock, times(10)).addCatalog(Mockito.<Path> any(), Mockito.<Path> any());
}
@Test
......
@rem ##########################################################################
@rem
@rem A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
@rem If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
@rem
@rem ##########################################################################
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..
@rem================================================
IF exist "%APP_HOME%/jre" (set JAVA_HOME="%APP_HOME%/jre")
@rem================================================
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
:execute
@rem Execute DB connection script
"%JAVA_EXE%" -jar sqltool-2.4.1.jar --rcFile=sqltool.rc scheduler
#!/usr/bin/env bash
##############################################################################
##
## A Simple Shell Command To access HSQLDB CLI and connect by default to scheduler DB
## If you would like to connect to another ProActive DB, please configure the sqltool.rc file before running the script
##
##############################################################################
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/.." >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
################################################################
# if local JVM exists redefine JAVA_HOME
if [ -d "$APP_HOME/jre" ]; then
JAVA_HOME=$APP_HOME/jre
if [ -d "$APP_HOME/jre/Contents/Home" ]; then
# macos
JAVA_HOME=$APP_HOME/jre/Contents/Home
fi
fi
################################################################
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
exec "$JAVACMD" -jar sqltool-2.4.1.jar --rcFile=sqltool.rc scheduler
urlid scheduler
url jdbc:hsqldb:hsql://localhost:9001/scheduler
username scheduler
password
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment