Skip to content

Commit

Permalink
IBM Informix support (update VII).
Browse files Browse the repository at this point in the history
  • Loading branch information
langfr committed Jun 15, 2022
1 parent 83def72 commit 71da1ec
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 22 deletions.
16 changes: 11 additions & 5 deletions database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<version.db2>${version.db2-10.5}</version.db2>
<version.postgresql>42.3.3</version.postgresql>
<version.liquibase>4.8.0</version.liquibase>
<version.informix>4.10</version.informix>
<version.liquibase>4.4.0</version.liquibase>
<version.informix>4.50.3</version.informix>

<!-- CockroachDB is compatible with PostgreSQL 9.5,
so a different version of the JDBC driver needs to be used -->
Expand Down Expand Up @@ -93,6 +94,7 @@
<version>${version.postgresql}</version>
</dependency>
<dependency>
<<<<<<< 3ed6b1a4936388ebbb9c9debd1f7c4e0c9251495
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>${version.db2}</version>
Expand All @@ -105,6 +107,10 @@
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
=======
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
>>>>>>> IBM Informix support (update VII).
<version>${version.informix}</version>
</dependency>
</dependencies>
Expand Down Expand Up @@ -653,8 +659,8 @@

<dependencies>
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -666,8 +672,8 @@
<artifactId>sql-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>${version.informix}</version>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" slot="@version.jackson@">
<resources>
<resource-root path="jackson-datatype-jsr310-@version.jackson@.jar" />
</resources>

<dependencies>
<module name="com.fasterxml.jackson.core.jackson-databind" slot="@version.jackson.databind@" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class DbSqlSessionFactory implements SessionFactory {
public static final String MARIADB = "mariadb";
public static final String CRDB = "cockroachdb";
public static final String INFORMIX = "informix";
public static final String[] SUPPORTED_DATABASES = {MSSQL, DB2, ORACLE, H2, MYSQL, POSTGRES, MARIADB, INFORMIX};
public static final String[] SUPPORTED_DATABASES = {MSSQL, DB2, ORACLE, H2, MYSQL, POSTGRES, MARIADB, CRDB, INFORMIX};

protected static final Map<String, Map<String, String>> databaseSpecificStatements = new HashMap<>();

Expand Down Expand Up @@ -724,11 +724,17 @@ public class DbSqlSessionFactory implements SessionFactory {
optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenFilterStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenAcquisitionStatements.put(INFORMIX, "");
databaseSpecificLimitBeforeWithoutOffsetStatements.put(INFORMIX, "FIRST ${maxResults}");
databaseSpecificLimitAfterWithoutOffsetStatements.put(INFORMIX, "");
databaseSpecificOrderByStatements.put(INFORMIX, defaultOrderBy);
databaseSpecificLimitBeforeNativeQueryStatements.put(INFORMIX, "");
databaseSpecificDistinct.put(INFORMIX, "distinct");
databaseSpecificNumericCast.put(INFORMIX, "");

databaseSpecificCountDistinctBeforeStart.put(INFORMIX, defaultDistinctCountBeforeStart);
databaseSpecificCountDistinctBeforeEnd.put(INFORMIX, defaultDistinctCountBeforeEnd);
databaseSpecificCountDistinctAfterEnd.put(INFORMIX, defaultDistinctCountAfterEnd);

databaseSpecificEscapeChar.put(INFORMIX, defaultEscapeChar);

Expand All @@ -745,7 +751,31 @@ public class DbSqlSessionFactory implements SessionFactory {

databaseSpecificDaysComparator.put(INFORMIX, "DATE(${date}) + ${days} <= #{currentTimestamp}");

databaseSpecificCollationForCaseSensitivity.put(INFORMIX, "");

addDatabaseSpecificStatement(INFORMIX, "insertByteArray", "insertByteArray_postgres");
addDatabaseSpecificStatement(INFORMIX, "updateByteArray", "updateByteArray_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectByteArray", "selectByteArray_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectByteArrays", "selectByteArrays_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourceByDeploymentIdAndResourceName", "selectResourceByDeploymentIdAndResourceName_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourceByDeploymentIdAndResourceNames", "selectResourceByDeploymentIdAndResourceNames_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourceByDeploymentIdAndResourceId", "selectResourceByDeploymentIdAndResourceId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourceByDeploymentIdAndResourceIds", "selectResourceByDeploymentIdAndResourceIds_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourcesByDeploymentId", "selectResourcesByDeploymentId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectResourceById", "selectResourceById_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectLatestResourcesByDeploymentName", "selectLatestResourcesByDeploymentName_postgres");
addDatabaseSpecificStatement(INFORMIX, "insertIdentityInfo", "insertIdentityInfo_postgres");
addDatabaseSpecificStatement(INFORMIX, "updateIdentityInfo", "updateIdentityInfo_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectIdentityInfoById", "selectIdentityInfoById_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectIdentityInfoByUserIdAndKey", "selectIdentityInfoByUserIdAndKey_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectIdentityInfoByUserId", "selectIdentityInfoByUserId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectIdentityInfoDetails", "selectIdentityInfoDetails_postgres");
addDatabaseSpecificStatement(INFORMIX, "insertComment", "insertComment_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectCommentsByTaskId", "selectCommentsByTaskId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectCommentsByProcessInstanceId", "selectCommentsByProcessInstanceId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectCommentByTaskIdAndCommentId", "selectCommentByTaskIdAndCommentId_postgres");
addDatabaseSpecificStatement(INFORMIX, "selectFilterByQueryCriteria", "selectFilterByQueryCriteria_oracleDb2");
addDatabaseSpecificStatement(INFORMIX, "selectFilter", "selectFilter_postgres");

addDatabaseSpecificStatement(INFORMIX, "deleteAttachmentsByRemovalTime", "deleteAttachmentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteCommentsByRemovalTime", "deleteCommentsByRemovalTime_informix");
Expand All @@ -764,6 +794,8 @@ public class DbSqlSessionFactory implements SessionFactory {
addDatabaseSpecificStatement(INFORMIX, "deleteUserOperationLogByRemovalTime", "deleteUserOperationLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteByteArraysByRemovalTime", "deleteByteArraysByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricBatchesByRemovalTime", "deleteHistoricBatchesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteAuthorizationsByRemovalTime", "deleteAuthorizationsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteTaskMetricsByRemovalTime", "deleteTaskMetricsByRemovalTime_informix");

constants = new HashMap<String, String>();
constants.put("constant.event", "'event'");
Expand All @@ -774,6 +806,7 @@ public class DbSqlSessionFactory implements SessionFactory {
constants.put("constant.datepart.minute", "MINUTE");
constants.put("constant.null.startTime", "CAST(NULL AS DATETIME) AS START_TIME_");
constants.put("constant.varchar.cast", "'${key}'");
constants.put("constant.integer.cast", "cast(NULL as integer)");
constants.put("constant.null.reporter", "CAST(NULL AS VARCHAR(255)) AS REPORTER_");
dbSpecificConstants.put(INFORMIX, constants);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
--
-- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
-- under one or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information regarding copyright
-- ownership. Camunda licenses this file to you under the Apache License,
-- Version 2.0; you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
Expand Down Expand Up @@ -39,6 +40,15 @@ values ('history.cleanup.job.lock', '0', 1);
insert into ACT_GE_PROPERTY
values ('startup.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('historyLevel', '3', 1);

insert into ACT_GE_PROPERTY
values ('telemetry.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('installationId.lock', '0', 1);

create table ACT_GE_BYTEARRAY (
ID_ varchar(64) not null,
REV_ integer,
Expand All @@ -54,6 +64,16 @@ create table ACT_GE_BYTEARRAY (
primary key (ID_)
);

create table ACT_GE_SCHEMA_LOG (
ID_ varchar(64) not null,
TIMESTAMP_ datetime year to fraction(5),
VERSION_ varchar(255),
primary key (ID_)
);

insert into ACT_GE_SCHEMA_LOG
values ('0', CURRENT, '7.15.0');

create table ACT_RE_DEPLOYMENT (
ID_ varchar(64) not null,
NAME_ varchar(255),
Expand Down Expand Up @@ -101,8 +121,10 @@ create table ACT_RU_JOB (
RETRIES_ integer,
EXCEPTION_STACK_ID_ varchar(64),
EXCEPTION_MSG_ lvarchar(4000),
FAILED_ACT_ID_ varchar(255),
DUEDATE_ datetime year to fraction(5),
REPEAT_ varchar(255),
REPEAT_OFFSET_ bigint default 0,
HANDLER_TYPE_ varchar(255),
HANDLER_CFG_ lvarchar(4000),
DEPLOYMENT_ID_ varchar(64),
Expand All @@ -126,6 +148,7 @@ create table ACT_RU_JOBDEF (
SUSPENSION_STATE_ integer,
JOB_PRIORITY_ bigint,
TENANT_ID_ varchar(64),
DEPLOYMENT_ID_ varchar(64),
primary key (ID_)
);

Expand All @@ -148,6 +171,17 @@ create table ACT_RE_PROCDEF (
primary key (ID_)
);

create table ACT_RE_CAMFORMDEF (
ID_ varchar(64) not null,
REV_ integer,
KEY_ varchar(255) not null,
VERSION_ integer not null,
DEPLOYMENT_ID_ varchar(64),
RESOURCE_NAME_ lvarchar(4000),
TENANT_ID_ varchar(64),
primary key (ID_)
);

create table ACT_RU_TASK (
ID_ varchar(64) not null,
REV_ integer,
Expand Down Expand Up @@ -192,9 +226,11 @@ create table ACT_RU_VARIABLE (
NAME_ varchar(255) not null,
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
CASE_EXECUTION_ID_ varchar(64),
CASE_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
BATCH_ID_ varchar(64),
BYTEARRAY_ID_ varchar(64),
DOUBLE_ double precision,
LONG_ bigint,
Expand Down Expand Up @@ -229,13 +265,15 @@ create table ACT_RU_INCIDENT (
INCIDENT_TYPE_ varchar(255) not null,
EXECUTION_ID_ varchar(64),
ACTIVITY_ID_ varchar(255),
FAILED_ACTIVITY_ID_ varchar(255),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
CAUSE_INCIDENT_ID_ varchar(64),
ROOT_CAUSE_INCIDENT_ID_ varchar(64),
CONFIGURATION_ varchar(255),
TENANT_ID_ varchar(64),
JOB_DEF_ID_ varchar(64),
ANNOTATION_ lvarchar(4000),
primary key (ID_)
);

Expand All @@ -248,6 +286,8 @@ create table ACT_RU_AUTHORIZATION (
RESOURCE_TYPE_ integer not null,
RESOURCE_ID_ varchar(255),
PERMS_ integer,
REMOVAL_TIME_ datetime year to fraction(5),
ROOT_PROC_INST_ID_ varchar(64),
primary key (ID_)
);

Expand All @@ -272,6 +312,13 @@ create table ACT_RU_METER_LOG (
primary key (ID_)
);

create table ACT_RU_TASK_METER_LOG (
ID_ varchar(64) not null,
ASSIGNEE_HASH_ bigint,
TIMESTAMP_ datetime year to fraction(5),
primary key (ID_)
);

create table ACT_RU_EXT_TASK (
ID_ varchar(64) not null,
REV_ integer not null,
Expand Down Expand Up @@ -316,13 +363,17 @@ create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_);
create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_);
create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_);
create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_);
create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_);

create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_);
-- create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_);

create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_);
create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_);
Expand Down Expand Up @@ -487,6 +538,13 @@ alter table ACT_RU_BATCH
references ACT_RU_JOBDEF (ID_)
constraint ACT_FK_BATCH_JOB_DEF;

create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_);

alter table ACT_RU_VARIABLE
add constraint foreign key (BATCH_ID_)
references ACT_RU_BATCH (ID_)
constraint ACT_FK_VAR_BATCH;

-- indexes for concurrency problems - https://app.camunda.com/jira/browse/CAM-1646 --
-- create index ACT_IDX_EXECUTION_PROC on ACT_RU_EXECUTION(PROC_DEF_ID_);
-- create index ACT_IDX_EXECUTION_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
Expand Down Expand Up @@ -526,4 +584,8 @@ create index ACT_IDX_PROCDEF_DEPLOYMENT_ID on ACT_RE_PROCDEF(DEPLOYMENT_ID_);
create index ACT_IDX_PROCDEF_TENANT_ID on ACT_RE_PROCDEF(TENANT_ID_);
create index ACT_IDX_PROCDEF_VER_TAG on ACT_RE_PROCDEF(VERSION_TAG_);

-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616
create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_);
create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_);

create function MINUTE ( param1 datetime year to fraction ) returning integer; define rv integer; select to_char(param1, "%M" )::int into rv from sysmaster:sysdual; return rv; end function;
Loading

0 comments on commit 71da1ec

Please sign in to comment.