上来,咱们先说下问题:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ru_timer_job" does not exist
Position: 25
### The error may exist in org/activiti/db/mapping/entity/TimerJob.xml
### The error may involve org.activiti.engine.impl.persistence.entity.TimerJobEntityImpl.selectTimerJobsToExecute-Inline
### The error occurred while setting parameters
### SQL: select RES.* from ACT_RU_TIMER_JOB RES where DUEDATE_ <= ? and LOCK_OWNER_ is null LIMIT ? OFFSET ?
### Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ru_timer_job" does not exist
Position: 25
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.1.jar:3.5.1]
还有这些:
2021-09-09 09:41:32.328 [activiti-acquire-async-jobs] [] [ERROR] org.activiti.engine.impl.interceptor.CommandContext#logException:122 - Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ru_job" does not exist
Position: 24
### The error may exist in org/activiti/db/mapping/entity/Job.xml
### The error may involve org.activiti.engine.impl.persistence.entity.JobEntityImpl.selectJobsToExecute-Inline
### The error occurred while setting parameters
### SQL: select RES.* from ACT_RU_JOB RES where LOCK_EXP_TIME_ is null LIMIT ? OFFSET ?
### Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ru_job" does not exist
Position: 24
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ge_property" does not exist
Position: 15
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntityImpl.selectProperty-Inline
### The error occurred while setting parameters
### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?
### Cause: com.kingbase8.util.KSQLException: ERROR: relation "act_ge_property" does not exist
Position: 15
这些“ACT”开头的数据库表,都是Activiti依赖的表。先声明,这些表中在人大金仓数据库里已经创建完成了,表中也有数据,并且“databaseSchemaUpdate”属性设置为“none”。也是按照人大金仓官方教程进行activiti的适配。大家有不懂的,可以参考下官方适配文档说明,地址为:https://help.kingbase.com.cn/login#
一切按照流程进行配置,但是还是一直报错。经过几天的排查填坑,终于找到了问题所在,也就是yml文件中,数据库URL地址配置的时候,一定要加上"currentSchema"。只有指定了schema,数据库才能获取到数据,否则应该是到默认的数据库实例中获取数据,就会报错该表不存在的问题。
例如:
url: jdbc:kingbase8://1.1.2.5:9180/dataName?currentSchema=dataName,productName=PostgreSQL,SYS_CATALOG,PUBLIC
最后,支持下国产数据库。未来的路还很长,希望国产数据库越来越强大,优化越来越好。