Unverified Commit 8d2379f7 authored by Mohamed Boussaa's avatar Mohamed Boussaa Committed by GitHub
Browse files

Set PCA server DB connection (#3785)

parent c0434f74
# 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
......
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