Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第1张

 

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第2张

常用数据连接池种类:

Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第3张

 

Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第4张

不一样的地方在于filters过滤器,设置了统计、和记录

 

avtiviti支持的数据库有:

Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第5张

 

 Activiti6-数据库配置-dbconfig(学习笔记) 随笔 第6张 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">


    <!-- 1 基于H2内存数据库 的流程引擎配置,也是在什么都没配置时的默认配置-->
    <!--
    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000;MVCC=TRUE" />
        <property name="jdbcDriver" value="org.h2.Driver" />
        <property name="jdbcUsername" value="sa" />
        <property name="jdbcPassword" value="" />
    </bean>
    -->

    <!-- StandaloneInMemProcessEngineConfiguration里面databaseSchemaUpdate默认为
    “create-drop”,即用时自动创建表,关闭时自动删除表(ps:对应库为空库,中必须无表)
           -->
    <bean id="processEngineConfiguration"
          class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <!--<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti6unit?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false" />
        <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
        <property name="jdbcUsername" value="root" />
        <property name="jdbcPassword" value="root" />-->

        <!--默认设置-->
        <!--<property name="databaseSchemaUpdate" value="create-drop" />-->
        <property name="databaseSchemaUpdate" value="true" />

        <property name="dataSource" ref="dataSource" />

        <!-- 其他一些属性 -->
        <!-- 给表加上前缀
        <property name="databaseTablePrefix" value="t_" />
         -->

    </bean>

    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="url" value="jdbc:mysql://localhost:3306/activiti6unit?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false" />
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="username" value="root" />
        <property name="password" value="root" />
        <property name="initialSize" value="1" />
        <property name="maxActive" value="10" />
        <property name="filters" value="stat,slf4j"/>
    </bean>

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄