Skip to content

Commit

Permalink
IBM Informix support (update VI).
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Langelage authored and langfr committed Apr 28, 2021
1 parent 5423487 commit 08fceaa
Show file tree
Hide file tree
Showing 27 changed files with 416 additions and 24 deletions.
Expand Up @@ -686,15 +686,34 @@ public class DbSqlSessionFactory implements SessionFactory {

addDatabaseSpecificStatement(INFORMIX, "selectFilterByQueryCriteria", "selectFilterByQueryCriteria_oracleDb2");

addDatabaseSpecificStatement(INFORMIX, "deleteAttachmentsByRemovalTime", "deleteAttachmentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteCommentsByRemovalTime", "deleteCommentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricActivityInstancesByRemovalTime", "deleteHistoricActivityInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionInputInstancesByRemovalTime", "deleteHistoricDecisionInputInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionInstancesByRemovalTime", "deleteHistoricDecisionInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionOutputInstancesByRemovalTime", "deleteHistoricDecisionOutputInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDetailsByRemovalTime", "deleteHistoricDetailsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteExternalTaskLogByRemovalTime", "deleteExternalTaskLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricIdentityLinkLogByRemovalTime", "deleteHistoricIdentityLinkLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricIncidentsByRemovalTime", "deleteHistoricIncidentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteJobLogByRemovalTime", "deleteJobLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricProcessInstancesByRemovalTime", "deleteHistoricProcessInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricTaskInstancesByRemovalTime", "deleteHistoricTaskInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricVariableInstancesByRemovalTime", "deleteHistoricVariableInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteUserOperationLogByRemovalTime", "deleteUserOperationLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteByteArraysByRemovalTime", "deleteByteArraysByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricBatchesByRemovalTime", "deleteHistoricBatchesByRemovalTime_informix");

constants = new HashMap<String, String>();
constants.put("constant.event", "'event'");
constants.put("constant.op_message", "NEW_VALUE_ || '_|_' || PROPERTY_");
constants.put("constant_for_update", "for update");
constants.put("constant.datepart.quarter", "QUARTER");
constants.put("constant.datepart.month", "MONTH");
constants.put("constant.datepart.minute", "MINUTE");
constants.put("constant.null.startTime", "null START_TIME_");
constants.put("constant.null.startTime", "CAST(NULL AS DATETIME) AS START_TIME_");
constants.put("constant.varchar.cast", "'${key}'");
constants.put("constant.null.reporter", "CAST(NULL AS VARCHAR(255)) AS REPORTER_");
dbSpecificConstants.put(INFORMIX, constants);
}

Expand Down
Expand Up @@ -133,8 +133,11 @@ public static boolean checkForeignKeyConstraintViolation(Throwable cause) {
List<SQLException> relatedSqlExceptions = findRelatedSqlExceptions(cause);
for (SQLException exception : relatedSqlExceptions) {

// Exception.message can be null on Informix
if (exception.getMessage() == null) {
return false;
// PostgreSQL doesn't allow for a proper check
if ("23503".equals(exception.getSQLState()) && exception.getErrorCode() == 0) {
} else if ("23503".equals(exception.getSQLState()) && exception.getErrorCode() == 0) {
return false;
} else if (
// SqlServer
Expand Down Expand Up @@ -170,7 +173,10 @@ public static boolean checkVariableIntegrityViolation(Throwable cause) {

List<SQLException> relatedSqlExceptions = findRelatedSqlExceptions(cause);
for (SQLException exception : relatedSqlExceptions) {
if (
// Exception.message can be null on Informix
if (exception.getMessage() == null) {
return false;
} else if (
// MySQL & MariaDB
(exception.getMessage().toLowerCase().contains("act_uniq_variable") && "23000".equals(exception.getSQLState()) && exception.getErrorCode() == 1062)
// PostgreSQL
Expand Down
@@ -1,3 +1,19 @@
--
-- 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.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- create case definition table --

create table ACT_RE_CASE_DEF (
Expand Down
@@ -1,3 +1,19 @@
--
-- 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.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

create table ACT_HI_CASEINST (
ID_ varchar(64) not null,
CASE_INST_ID_ varchar(64) not null,
Expand Down Expand Up @@ -36,7 +52,6 @@ create table ACT_HI_CASEACTINST (
primary key (ID_)
);


create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_);
create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_);
create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_);
Expand Down
@@ -1,3 +1,19 @@
--
-- 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.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- create decision definition table --
create table ACT_RE_DECISION_DEF (
ID_ varchar(64) not null,
Expand Down
@@ -1,3 +1,19 @@
--
-- 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.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- create history decision instance table --
create table ACT_HI_DECINST (
ID_ varchar(64) not null,
Expand All @@ -13,9 +29,11 @@ create table ACT_HI_DECINST (
ACT_INST_ID_ varchar(64),
ACT_ID_ varchar(255),
EVAL_TIME_ datetime year to fraction(5) not null,
REMOVAL_TIME_ datetime year to fraction(5),
COLLECT_VALUE_ double precision,
USER_ID_ varchar(255),
ROOT_DEC_INST_ID_ varchar(64),
ROOT_PROC_INST_ID_ varchar(64),
DEC_REQ_ID_ varchar(64),
DEC_REQ_KEY_ varchar(255),
TENANT_ID_ varchar(64),
Expand All @@ -36,6 +54,8 @@ create table ACT_HI_DEC_IN (
TEXT2_ lvarchar(4000),
TENANT_ID_ varchar(64),
CREATE_TIME_ datetime year to fraction(5),
ROOT_PROC_INST_ID_ varchar(64),
REMOVAL_TIME_ datetime year to fraction(5),
primary key (ID_)
);

Expand All @@ -56,6 +76,8 @@ create table ACT_HI_DEC_OUT (
TEXT2_ lvarchar(4000),
TENANT_ID_ varchar(64),
CREATE_TIME_ datetime year to fraction(5),
ROOT_PROC_INST_ID_ varchar(64),
REMOVAL_TIME_ datetime year to fraction(5),
primary key (ID_)
);

Expand All @@ -71,9 +93,15 @@ create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_);
create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_);
create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_);
create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_);
create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_);
create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_);

create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_);
create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_);
create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_);
create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_);

create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_);
create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_);
create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_);
create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_);
@@ -1,3 +1,19 @@
--
-- 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.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

create table ACT_GE_PROPERTY (
NAME_ varchar(64) not null,
VALUE_ varchar(255),
Expand Down Expand Up @@ -31,6 +47,10 @@ create table ACT_GE_BYTEARRAY (
BYTES_ byte,
GENERATED_ boolean,
TENANT_ID_ varchar(64),
TYPE_ integer,
CREATE_TIME_ datetime year to fraction(5),
ROOT_PROC_INST_ID_ varchar(64),
REMOVAL_TIME_ datetime year to fraction(5),
primary key (ID_)
);

Expand All @@ -46,6 +66,7 @@ create table ACT_RE_DEPLOYMENT (
create table ACT_RU_EXECUTION (
ID_ varchar(64) not null,
REV_ integer,
ROOT_PROC_INST_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
BUSINESS_KEY_ varchar(255),
PARENT_ID_ varchar(64),
Expand Down Expand Up @@ -90,6 +111,7 @@ create table ACT_RU_JOB (
PRIORITY_ bigint not null default 0,
SEQUENCE_COUNTER_ bigint,
TENANT_ID_ varchar(64),
CREATE_TIME_ datetime year to fraction(5),
primary key (ID_)
);

Expand Down Expand Up @@ -285,9 +307,11 @@ create table ACT_RU_BATCH (
SUSPENSION_STATE_ integer,
CONFIGURATION_ varchar(255),
TENANT_ID_ varchar(64),
CREATE_USER_ID_ varchar(255),
primary key (ID_)
);

create index ACT_IDX_EXECUTION_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);
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_);
Expand All @@ -308,6 +332,7 @@ create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_);
create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_);
create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_);

-- new metric milliseconds column
create index ACT_IDX_METER_LOG_MS on ACT_RU_METER_LOG(MILLISECONDS_);
Expand All @@ -323,7 +348,6 @@ create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_);
create index ACT_IDX_EXT_TASK_PRIORITY on ACT_RU_EXT_TASK(PRIORITY_);
create index ACT_IDX_EXT_TASK_ERR_DETAILS on ACT_RU_EXT_TASK(ERROR_DETAILS_ID_);
create index ACT_IDX_AUTH_GROUP_ID on ACT_RU_AUTHORIZATION(GROUP_ID_);
create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_);

create function ACT_FCT_USER_ID_OR_ID_(USER_ID_ varchar(255),ID_ varchar(64)) returning varchar(255) with (not variant); return nvl(USER_ID_,ID_); end function;
create function ACT_FCT_GROUP_ID_OR_ID_(GROUP_ID_ varchar(255),ID_ varchar(64)) returning varchar(255) with (not variant); return nvl(GROUP_ID_,ID_); end function;
Expand Down Expand Up @@ -490,6 +514,8 @@ create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_);


-- indexes to improve deployment
create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_);
create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_);
create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_);
create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_);
create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_);
Expand Down

0 comments on commit 08fceaa

Please sign in to comment.