Commit a2d8786b authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.9.0'

parents c6a59a74 cd837d60
......@@ -12,6 +12,7 @@ stages:
- test
- release
- docker
- publish
- docs
# ---------------------------------------------------------------
......@@ -28,6 +29,8 @@ variables:
MAVEN_REPO_URL: https://gitlab.ifremer.fr/api/v4/projects/1272/packages/maven
APP_CORE_MODULE: sumaris-core
APP_DB_MODULE: sumaris-db
APP_SHARED_MODULE: sumaris-core-shared
APP_CORE_MODULE: sumaris-core
APP_WAR_MODULE: sumaris-server
ARTIFACT_WAR_FILE: "${APP_WAR_MODULE}/target/*.war"
ARTIFACT_CONFIG_FILES: "${APP_WAR_MODULE}/target/classes/*.properties"
......@@ -71,7 +74,7 @@ variables:
- ${ARTIFACT_CONFIG_FILES}
reports:
dotenv: ${ENV_FILE}
expire_in: 60 minutes
expire_in: 72 hours
build:
extends: .build
......@@ -79,6 +82,7 @@ build:
only:
- develop
- feature/imagine
- tags
failsafe-build:
extends: .build
......@@ -114,12 +118,43 @@ docker:ci:
artifacts:
paths:
- target/ci/Dockerfile
expire_in: 60 minutes
expire_in: 72 hours
# ---------------------------------------------------------------
# Test jobs
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# Tests jobs
# ---------------------------------------------------------------
.test:
stage: test
tags: [sih_public_runner]
script:
- mvn verify surefire-report:report -s ./ci_settings.xml -q
environment:
name: test
artifacts:
paths:
- ${APP_SHARED_MODULE}/site/surefire-report.html
- ${APP_SHARED_MODULE}/target/surefire-reports/*
- ${ARTIFACT_CORE_MODULE}/site/surefire-report.html
- ${ARTIFACT_CORE_MODULE}/target/surefire-reports/*
- ${ARTIFACT_WAR_MODULE}/target/surefire-reports/*
- ${ARTIFACT_WAR_MODULE}/site/surefire-report.html
expire_in: 72 hours
test:
extends: .test
image: ${CI_BUILD_IMAGE}
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH =~ /^feature/'
when: manual
allow_failure: true
sonarqube:
stage: test
tags:
......@@ -143,28 +178,6 @@ sonarqube:
- develop
when: manual
# ---------------------------------------------------------------
# Deploy jobs
# ---------------------------------------------------------------
#.deploy-file:
# stage: deploy
# tags: [sih_public_runner]
# script:
# - APP_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
# - APP_GROUP_ID=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.groupId -q -DforceStdout)
# - mvn -s ./ci_settings.xml deploy:deploy-file -DgroupId=${APP_GROUP_ID} -DartifactId=${APP_WAR_MODULE} -Dversion=${APP_VERSION} -Dfile=${APP_WAR_MODULE}/target/${APP_WAR_MODULE}-${APP_VERSION}.war -DrepositoryId=job-maven -Durl=$MAVEN_REPO_URL
# only:
# - develop
#
#fast-deploy-file:
# extends: .deploy-file
# needs: [fast-build]
#
#failsafe-deploy-file:
# extends: .deploy-file
# needs: [failsafe-build]
# ---------------------------------------------------------------
# Release jobs
# ---------------------------------------------------------------
......@@ -179,19 +192,21 @@ sonarqube:
- git reset --hard develop
- git fetch origin
script:
- echo "Preparing release..."
- git branch -D release/$RELEASE_VERSION || true
- git pull origin develop && git checkout develop && git status
- mvn -s ./ci_settings.xml -B gitflow:release-start --batch-mode -DreleaseVersion="$RELEASE_VERSION"
- echo "Performing release..."
- mvn clean install -s ./ci_settings.xml --batch-mode -DperformRelease -DskipTests
- echo "Creating test DB..."
- mvn -pl ${APP_CORE_MODULE} -q -Prun,hsqldb -DskipTests --batch-mode
- cd ${APP_CORE_MODULE}/target && tar -cf "${APP_DB_MODULE}-${RELEASE_VERSION}.tar.gz" db && cd ../..
- echo "Pushing changes to upstream"
- git commit -a -m "Release $RELEASE_VERSION"
- git status
- mvn gitflow:release-finish
- cd src/scripts
- ./release.sh pre ${RELEASE_VERSION}
# - echo "Preparing release..."
# - git branch -D release/$RELEASE_VERSION || true
# - git pull origin develop && git checkout develop && git status
# - mvn -s ./ci_settings.xml -B gitflow:release-start --batch-mode -DreleaseVersion="$RELEASE_VERSION"
# - echo "Performing release..."
# - mvn clean install -s ./ci_settings.xml --batch-mode -DperformRelease -DskipTests
# - echo "Creating test DB..."
# - mvn -pl ${APP_CORE_MODULE} -q -Prun,hsqldb -DskipTests --batch-mode
# - cd ${APP_CORE_MODULE}/target && tar -cf "${APP_DB_MODULE}-${RELEASE_VERSION}.tar.gz" db && cd ../..
# - echo "Pushing changes to upstream"
# - git commit -a -m "Release $RELEASE_VERSION"
# - git status
# - mvn gitflow:release-finish
after_script:
- echo "APP_VERSION=${RELEASE_VERSION}" > ${ENV_FILE}
artifacts:
......@@ -239,7 +254,10 @@ gitlab-release:
extends: .docker
stage: docker
script:
# Create the target directory
# Build variables: set default values
- export IMAGE_USERID=${IMAGE_USERID:-20001}
- export IMAGE_GROUPID=${IMAGE_GROUPID:-20001}
# Create the target directory, to build the image
- mkdir -p target/docker/config
- cp -rf ${APP_WAR_MODULE}/src/main/docker/* target/docker/
- cp -f ${ARTIFACT_WAR_FILE} target/docker/app.war
......@@ -248,25 +266,25 @@ gitlab-release:
- cd target/docker
# Build docker image
- docker pull ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} --pull -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} .
#- docker build --no-cache -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} .
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} --pull -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} --build-arg="USERID=${IMAGE_USERID}" --build-arg="GROUPID=${IMAGE_GROUPID}" .
#- docker build --no-cache -t ${CI_REGISTRY_IMAGE}:${IMAGE_TAG} --build-arg="USERID=${IMAGE_USERID}" --build-arg="GROUPID=${IMAGE_GROUPID}" .
- docker push ${CI_REGISTRY_IMAGE}:${IMAGE_TAG}
artifacts:
paths:
- target/docker
expire_in: 60 minutes
expire_in: 72 hours
docker:develop:
extends: .docker-build
variables:
IMAGE_TAG: develop
IMAGE_TAG: 'develop'
only:
- develop
docker:imagine:
extends: .docker-build
variables:
IMAGE_TAG: imagine
IMAGE_TAG: 'imagine'
only:
- feature/imagine
......@@ -277,28 +295,81 @@ docker:release:
only:
- tags
docker:production:
extends: .docker-build
variables:
IMAGE_TAG: 'production'
IMAGE_USERID: ${PRODUCTION_IMAGE_USERID}
IMAGE_GROUPID: ${PRODUCTION_IMAGE_GROUPID}
only:
- tags
- feature/imagine
when: manual
# ---------------------------------------------------------------
# Publish jobs
# ---------------------------------------------------------------
.deploy-file:
stage: publish
tags: [sih_public_runner]
script:
- APP_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)
- APP_GROUP_ID=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.groupId -q -DforceStdout)
- mvn deploy:deploy-file -s ./ci_settings.xml -DgroupId=${APP_GROUP_ID} -DartifactId=${APP_WAR_MODULE} -Dversion=${APP_VERSION} -Dfile=${APP_WAR_MODULE}/target/${APP_WAR_MODULE}-${APP_VERSION}.war -DrepositoryId=job-maven -Durl=$MAVEN_REPO_URL
deploy-file:
extends: .deploy-file
needs: [build]
only:
- develop
when: manual
failsafe-deploy-file:develop:
extends: .deploy-file
needs: [failsafe-build]
only:
- develop
when: manual
deploy-file:release:
extends: .deploy-file
image: ${CI_BUILD_IMAGE}
needs: [build]
allow_failure: true
only:
- tags
# ---------------------------------------------------------------
# Docs jobs
# ---------------------------------------------------------------
pages:
.pages:
stage: docs
image: ${CI_BUILD_IMAGE}
tags: [sih_public_runner]
image: python:3.7-alpine
before_script:
- git submodule foreach git fetch origin
- git submodule foreach git pull
script:
- Echo "Generate SVG images"
- git submodule foreach ./generate.sh
- mvn -s ./ci_settings.xml site -q -Prun,hsqldb -DperformRelease
- echo "---- Generating SVG, from '*.plantuml' files..."
- git submodule foreach ./generate.sh || true
- echo "---- Generating Maven site..."
- mvn site -s ./ci_settings.xml -q -Phsqldb -DperformRelease
after_script:
- mv target/site public
allow_failure: true
artifacts:
paths:
- public
pages:develop:
extends: .pages
only:
- develop
when: manual
pages:release:
extends: .pages
only:
- tags
......@@ -3,7 +3,7 @@
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.7</version>
<version>1.9.0</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
......
Subproject commit 3b6e149ac009099f8234c3825cf8bb3bacb01f97
Subproject commit 7a81f76fac53e140fcd83394212b153bc9de24a0
......@@ -5,7 +5,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.7</version>
<version>1.9.0</version>
</parent>
<artifactId>sumaris-core-extraction</artifactId>
......
......@@ -255,6 +255,7 @@ public class ExtractionStrategyDaoImpl<C extends ExtractionStrategyContextVO, F
// Bind some referential ids
xmlQuery.bind("strategyLabelPmfmId", String.valueOf(PmfmEnum.STRATEGY_LABEL.getId()));
xmlQuery.bind("tagIdPmfmId", String.valueOf(PmfmEnum.TAG_ID.getId()));
return xmlQuery;
}
......
......@@ -125,10 +125,10 @@ public class Daos extends net.sumaris.core.dao.technical.Daos {
}
public static void commitIfHsqldb(DataSource dataSource) {
public static void commitIfHsqldbOrPgsql(DataSource dataSource) {
Connection conn = DataSourceUtils.getConnection(dataSource);
try {
if (net.sumaris.core.extraction.dao.technical.Daos.isHsqlDatabase(conn) && DataSourceUtils.isConnectionTransactional(conn, dataSource)) {
if ((net.sumaris.core.extraction.dao.technical.Daos.isHsqlDatabase(conn) || net.sumaris.core.extraction.dao.technical.Daos.isPostgresqlDatabase(conn)) && DataSourceUtils.isConnectionTransactional(conn, dataSource)) {
try {
conn.commit();
} catch (SQLException e) {
......@@ -146,7 +146,7 @@ public class Daos extends net.sumaris.core.dao.technical.Daos {
* @param columnNamesMapping
* @return
*/
public static String sqlReplaceColumnNames(String sqlQuery, Map<String, String> columnNamesMapping) {
public static String sqlReplaceColumnNames(String sqlQuery, Map<String, String> columnNamesMapping, Boolean lowercase) {
if (MapUtils.isEmpty(columnNamesMapping)) return sqlQuery; // Skip
sqlQuery = sqlQuery.toUpperCase();
......@@ -161,6 +161,20 @@ public class Daos extends net.sumaris.core.dao.technical.Daos {
"$1" + targetColumnName + "$2");
}
// for postgresql, lowercase queries are needed.
if (lowercase){
sqlQuery = sqlQuery.toLowerCase();
}
return sqlQuery;
}
/**
* Do column names replacement, but escape sql keyword (e.g. 'DATE' replacement will keep TO_DATE(...) unchanged)
* @param sqlQuery
* @param columnNamesMapping
* @return
*/
public static String sqlReplaceColumnNames(String sqlQuery, Map<String, String> columnNamesMapping) {
return sqlReplaceColumnNames(sqlQuery, columnNamesMapping, false);
}
}
......@@ -41,12 +41,9 @@ import net.sumaris.core.service.referential.ReferentialService;
import net.sumaris.core.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.hibernate.dialect.Dialect;
import org.hibernate.query.internal.NativeQueryImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.orm.hibernate5.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.annotation.PostConstruct;
import javax.persistence.Query;
......@@ -184,7 +181,7 @@ public abstract class ExtractionBaseDaoImpl extends HibernateDaoSupport {
xmlQuery.setXSLFileName(XSL_ORACLE_FILENAME);
}
else if (this.databaseType == DatabaseType.postgresql){
xmlQuery.setLowercaseAliases(true);
xmlQuery.setLowercase(true);
}
return xmlQuery;
}
......
......@@ -49,18 +49,18 @@ public class XMLQuery extends HSQLDBSingleXMLQuery {
private String xslFileName;
private boolean lowercaseAliases;
private boolean lowercase;
public XMLQuery() {
super();
xslFileName = super.getXSLFileName();
this.lowercaseAliases = false;
this.lowercase = false;
}
public XMLQuery(boolean lowercaseAliases) {
public XMLQuery(boolean lowercase) {
super();
xslFileName = super.getXSLFileName();
this.lowercaseAliases = lowercaseAliases;
this.lowercase = lowercase;
}
@Override
......@@ -74,12 +74,12 @@ public class XMLQuery extends HSQLDBSingleXMLQuery {
// let default values here for HSQLDB
public boolean isLowercaseAliases() {
return lowercaseAliases;
public boolean isLowercase() {
return lowercase;
}
public void setLowercaseAliases(boolean lowercaseAliases) {
this.lowercaseAliases = lowercaseAliases;
public void setLowercase(boolean lowercase) {
this.lowercase = lowercase;
}
/**
......@@ -155,7 +155,7 @@ public class XMLQuery extends HSQLDBSingleXMLQuery {
public String getSQLQueryAsString(){
String query = super.getSQLQueryAsString();
if (this.lowercaseAliases){
if (this.lowercase){
query = query.toLowerCase();
}
return query;
......
......@@ -196,7 +196,7 @@ public class SumarisTableMetadatas {
StringBuilder sb = new StringBuilder();
sb.append("SELECT COUNT(*) FROM (")
.append(getSelectGroupByQuery(tableName, columnNames, whereClause, groupByColumnNames, null, null))
.append(")");
.append(") \"select_group\"");
return sb.toString();
}
......
......@@ -23,6 +23,7 @@
package net.sumaris.core.extraction.dao.trip.free;
import com.google.common.base.Preconditions;
import net.sumaris.core.dao.technical.DatabaseType;
import net.sumaris.core.extraction.dao.technical.Daos;
import net.sumaris.core.extraction.dao.technical.XMLQuery;
import net.sumaris.core.extraction.dao.trip.rdb.ExtractionRdbTripDaoImpl;
......@@ -99,6 +100,10 @@ public class ExtractionFree1TripDaoImpl<C extends ExtractionRdbTripContextVO, F
// WIDTH_GEAR Largeur cumulée (drague), missing in SUMARIS
// SEINE_LENGTH Longueur de la bolinche ou senne missing in SUMARIS
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
return xmlQuery;
}
......
......@@ -24,6 +24,7 @@ package net.sumaris.core.extraction.dao.trip.free2;
import com.google.common.base.Preconditions;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.dao.technical.DatabaseType;
import net.sumaris.core.dao.technical.schema.SumarisDatabaseMetadata;
import net.sumaris.core.extraction.dao.technical.Daos;
import net.sumaris.core.extraction.dao.technical.XMLQuery;
......@@ -195,6 +196,10 @@ public class ExtractionFree2TripDaoImpl<C extends ExtractionFree2ContextVO, F ex
xmlQuery.setGroup("vesselFilter", CollectionUtils.isNotEmpty(context.getVesselIds()));
xmlQuery.bind("vesselIds", Daos.getSqlInNumbers(context.getVesselIds()));
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
return xmlQuery;
}
......
......@@ -375,6 +375,7 @@ public class AggregationRdbTripDaoImpl<
xmlQuery.setGroup("gearType", rawStationTable.hasColumn(AggRdbSpecification.COLUMN_GEAR_TYPE));
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
return xmlQuery;
......@@ -532,6 +533,7 @@ public class AggregationRdbTripDaoImpl<
// Enable/Disable group, on DBMS
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
// Enable/Disable group, on optional columns
......@@ -708,9 +710,11 @@ public class AggregationRdbTripDaoImpl<
// Enable/Disable group, on DBMS
xmlQuery.setGroup("hasId", hasId);
xmlQuery.setGroup("hsqldb-hasId", hasId && this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql-hasId", hasId && this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle-hasId", hasId && this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("hasSampleIds", hasSampleIds);
xmlQuery.setGroup("hsqldb-hasSampleIds", hasSampleIds && this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql-hasSampleIds", hasSampleIds && this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle-hasSampleIds", hasSampleIds && this.databaseType == DatabaseType.oracle);
return xmlQuery;
......@@ -789,7 +793,7 @@ public class AggregationRdbTripDaoImpl<
String sqlQuery = xmlQuery.getSQLQueryAsString();
// Do column nanes replacement (e.g. see FREE extraction)
sqlQuery = Daos.sqlReplaceColumnNames(sqlQuery, context.getColumnNamesMapping());
sqlQuery = Daos.sqlReplaceColumnNames(sqlQuery, context.getColumnNamesMapping(), xmlQuery.isLowercase());
return queryUpdate(sqlQuery);
}
......@@ -868,7 +872,8 @@ public class AggregationRdbTripDaoImpl<
c -> query(
Daos.sqlReplaceColumnNames(
String.format("SELECT DISTINCT %s FROM %s where %s IS NOT NULL", c, tableName, c),
context.getColumnNamesMapping()),
context.getColumnNamesMapping(),
xmlQuery.isLowercase()),
Object.class)
.stream()
.map(String::valueOf)
......
......@@ -299,6 +299,10 @@ public class ExtractionRdbTripDaoImpl<C extends ExtractionRdbTripContextVO, F ex
xmlQuery.setGroup("vesselFilter", CollectionUtils.isNotEmpty(context.getVesselIds()));
xmlQuery.bind("vesselIds", Daos.getSqlInNumbers(context.getVesselIds()));
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
return xmlQuery;
}
......@@ -424,6 +428,7 @@ public class ExtractionRdbTripDaoImpl<C extends ExtractionRdbTripContextVO, F ex
xmlQuery.bind("speciesListTableName", context.getSpeciesListTableName());
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
return xmlQuery;
......
......@@ -198,6 +198,7 @@ public class AggregationSurvivalTestDaoImpl<C extends AggregationSurvivalTestCon
xmlQuery.setGroup("gearType", stationTable.hasColumn(AggRdbSpecification.COLUMN_GEAR_TYPE));
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
return xmlQuery;
......@@ -264,6 +265,7 @@ public class AggregationSurvivalTestDaoImpl<C extends AggregationSurvivalTestCon
xmlQuery.setGroup("gearType", stationTable.hasColumn(AggRdbSpecification.COLUMN_GEAR_TYPE));
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
return xmlQuery;
......
......@@ -24,6 +24,7 @@ package net.sumaris.core.extraction.dao.trip.survivalTest;
import com.google.common.base.Preconditions;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.dao.technical.DatabaseType;
import net.sumaris.core.extraction.dao.technical.XMLQuery;
import net.sumaris.core.extraction.dao.trip.rdb.ExtractionRdbTripDaoImpl;
import net.sumaris.core.extraction.format.LiveFormatEnum;
......@@ -133,6 +134,10 @@ public class ExtractionSurvivalTestDaoImpl<C extends ExtractionSurvivalTestConte
xmlQuery.bind("sortingDateTimePmfmId", String.valueOf(PmfmEnum.SORTING_START_DATE_TIME.getId()));
xmlQuery.bind("sortingEndDateTimePmfmId", String.valueOf(PmfmEnum.SORTING_END_DATE_TIME.getId()));
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
return xmlQuery;
}
......@@ -180,6 +185,10 @@ public class ExtractionSurvivalTestDaoImpl<C extends ExtractionSurvivalTestConte
xmlQuery.bind("stationTableName", context.getStationTableName());
xmlQuery.bind("survivalTestTableName", context.getSurvivalTestTableName());
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
// aggregate insertion
execute(xmlQuery);
long count = countFrom(context.getSurvivalTestTableName());
......@@ -210,6 +219,10 @@ public class ExtractionSurvivalTestDaoImpl<C extends ExtractionSurvivalTestConte
xmlQuery.bind("stationTableName", context.getStationTableName());
xmlQuery.bind("releaseTableName", context.getReleaseTableName());
xmlQuery.setGroup("oracle", this.databaseType == DatabaseType.oracle);
xmlQuery.setGroup("hsqldb", this.databaseType == DatabaseType.hsqldb);
xmlQuery.setGroup("pgsql", this.databaseType == DatabaseType.postgresql);
// aggregate insertion
execute(xmlQuery);
long count = countFrom(context.getReleaseTableName());
......
......@@ -280,6 +280,7 @@ public class AggregationServiceImpl implements AggregationService {
int offset, int size, String sort, SortDirection direction) {
// Execute the aggregation
AggregationContextVO context = aggregate(type, filter, strata);
Daos.commitIfHsqldbOrPgsql(dataSource);