人大金仓KingbaseES适配Activiti工作流时踩下的坑

上来,咱们先说下问题:

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

最后,支持下国产数据库。未来的路还很长,希望国产数据库越来越强大,优化越来越好。

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值