activiti建表相关问题
Activiti建表报错
报错信息如下所示
在mysql url后加&nullCatalogMeansCurrent=true
,设置nullCatalogMeansCurrent=true,表示mysql默认当前数据库操作,在mysql-connector-java 5.xxx该参数默认为true,在6.xxx以上默认为false,因此需要设置nullCatalogMeansCurrent=true
Activiti一直查询ACT_RU_TIMER_JOB表
执行日志如下
Opening JDBC Connection
==> Preparing: select RES.* from ACT_RU_TIMER_JOB RES where DUEDATE_ <= ? and LOCK_OWNER_ is null LIMIT ? OFFSET ?
==> Preparing: select RES.* from ACT_RU_JOB RES where LOCK_EXP_TIME_ is null LIMIT ? OFFSET ?
==> Parameters: 1(Integer), 0(Integer)
==> Parameters: 2023-08-31 16:37:02.213(Timestamp), 1(Integer), 0(Integer)
<== Total: 0
<== Total: 0
在application.yml文件中添加
# 添加这个配置就不会一直调用了
# 在流程引擎启动就激活AsyncExecutor,异步 true false 关闭 (切记关闭)
async-executor-activate: false
完整的activiti配置如下:
spring:
activiti:
# 添加这个配置就不会一直调用了
# 在流程引擎启动就激活AsyncExecutor,异步 true false 关闭 (切记关闭)
async-executor-activate: false
# false:默认,数据库表不变,但是如果版本不对或者缺失表会抛出异常(生产使用)
# true:表不存在,自动创建(开发使用)
# create_drop: 启动时创建,关闭时删除表(测试使用)
# drop_create: 启动时删除表,在创建表 (不需要手动关闭引擎)
database-schema-update: true
#监测历史表是否存在,activities7默认不开启历史表
db-history-used: true
#none:不保存任何历史数据,流程中这是最高效的
#activity:只保存流程实例和流程行为
#audit:除了activity,还保存全部的流程任务以及其属性,audit为history默认值
#full:除了audit、还保存其他全部流程相关的细节数据,包括一些流程参数
history-level: full
#校验流程文件,默认校验resources下的process 文件夹的流程文件
check-process-definitions: true