activiti 报 next dbid
记录一下吧。
今天将生产环境的几个服务节点改成集群模式,其中包含activiti审批服务节点,其中各个服务几点间数据通信采用MQ(与本文无关)。
然后报出如题错误。
究其原因就是,在启动activiti自动审批工作流的时候,activiti会查询act_ge_property表中的值来标识唯一工作流。单机情况下不会出现此状况,集群情况下才会出现该表锁异常的情况,所以报出了此错误。
解决方法,就是在activiti配置文件中不让activiti在启动工作流的时候查询这张表,即采用主键注入策略,具体实行方法非常简单。
1、需在项目中引入java-uuid-generator-3.1.2.jar包。有了此包才能生成UUID。
2、在activiti配置文件中加入
<property name="idGenerator"><bean class="org.activiti.engine.impl.persistence.StrongUuidGenerator" /></property>
至于为什么要引入这个包,是因为:
package org.activiti.engine.impl.persistence; import org.activiti.engine.impl.cfg.IdGenerator; import com.fasterxml.uuid.EthernetAddress;
import com.fasterxml.uuid.Generators;
import com.fasterxml.uuid.impl.TimeBasedGenerator; /**
* {@link IdGenerator} implementation based on the current time and the ethernet
* address of the machine it is running on.
*
* @author Daniel Meyer
*/
public class StrongUuidGenerator implements IdGenerator { // different ProcessEngines on the same classloader share one generator.
protected static TimeBasedGenerator timeBasedGenerator; public StrongUuidGenerator() {
ensureGeneratorInitialized();
} protected void ensureGeneratorInitialized() {
if (timeBasedGenerator == null) {
synchronized (StrongUuidGenerator.class) {
if (timeBasedGenerator == null) {
timeBasedGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
}
}
}
} public String getNextId() {
return timeBasedGenerator.generate().toString();
} }
就OK了。
这样就可以采用主键注入策略,而不使用activiti表中的值。也就不会再报出这个错误。
参考文章链接地址:http://blog.csdn.net/kongqz/article/details/8027295
activiti 报 next dbid的更多相关文章
- activiti报错ProcessEngines.getDefaultProcessEngine()为null
activiti报错ProcessEngines.getDefaultProcessEngine()为null 文件名错误,默认加载classpath下面的activiti.cfg.xml,而不是ac ...
- springboot整合activiti报错[processes/]不存在解决方案
springboot整合activiti时,启动抛异常 nested exception is java.io.FileNotFoundException: class path resource [ ...
- 记一次使用logmnr查找操作人流程
经常遇到开发的需求,帮我查一下是谁修改了表里面的记录,是谁对表进行了DDL操作,此类问题可以使用logmnr解决 1.根据操作时间定位归档日志 SELECT name FROM V$ARCHIVED_ ...
- 【踩坑】activiti工作流的svg-xml解析报错
1.问题记录 工作流配置画模板的时候保存成功但是部署报错. IE下 activiti工作流解析xml报错 type "path" must be followed by eithe ...
- Activiti启动某个流程失败,页面报500
现象:Activiti启动某个流程失败,页面报500,错误日志如下. 2017-06-19 10:50:09 [org.activiti.engine.impl.interceptor.Command ...
- MyBatis Plus + Activiti 整合报错:org.springframework.beans.factory.UnsatisfiedDependencyException
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ind ...
- eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”
eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context ...
- ssm项目导入activiti依赖后jsp页面el表达式报错
错误原因:Tomcat8.x与activiti6.0依赖冲突导致 解决方法: 1.修改tomcat版本 2.在pom.xml中修改 在依赖中把 <dependency> <group ...
- 启动Activiti项目报错:org.activiti.engine.ActivitiObjectNotFoundException: no deployed process definition found with id '22501'
背景 启动activiti项目时,出现错误org.activiti.engine.ActivitiObjectNotFoundException: no deployed process defini ...
随机推荐
- Vue中 export default 和 export 区别
1.export与export default均可用于导出常量.函数.文件.模块等2.在一个文件或模块中,export.import可以有多个,export default仅有一个3.通过export ...
- dos2unix命令
dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter).DOS下的文本文件是以\r\n作为断行标志的 ...
- shell编程awk进阶
awk操作符 算术操作符: x+y, x-y, x*y, x/y, x^y, x%y -x: 转换为负数 +x: 转换为数值 字符串操作符:没有符号的操作符,字符串连接 赋值操作 ...
- 数据库 - Navicat与pymysql模块
一.Nabicat 在生产环境中操作MySQL数据库还是推荐使用命令行工具mysql,但在我们自己开发测试时, 可以使用可视化工具Navicat,以图形界面的形式操作MySQL数据库 官网下载:htt ...
- 帝国cms判断某一字段是否为空
<?php if(empty($navinfor[buy])) { ?> <? } else { ?> <h2 class="buy">< ...
- C语言编程练习
1.编程序实现求1-1000之间的所有奇数的和并输出. 解法1: int sum=0; for(int i=1;i<=1000;i++){ sum+=i%2?i:0; } printf(&quo ...
- Scala对class/object反射
近期有需求,要根据解析字符串,根据字符串的内容去调用方法.想到的基本就是使用反射.但是基本上能找到的资料,全没有讲scala的反射.只有零星点点的讲解.大部分都是用scala的语法写java反射最后翻 ...
- dfs1321
比较抽象吧,看到题时一点思想也没有,参考了别人的代码才知道...渣渣 #include <iostream>#include <stdio.h>#include <str ...
- [LeetCode] 610. Triangle Judgement_Easy tag: SQL
A pupil Tim gets homework to identify whether three line segments could possibly form a triangle. Ho ...
- 数据分析与挖掘 - R语言:贝叶斯分类算法(案例三)
案例三比较简单,不需要自己写公式算法,使用了R自带的naiveBayes函数. 代码如下: > library(e1071)> classifier<-naiveBayes(iris ...