Spring事务传播属性

2023-11-20

参考文献

Spring事务传播属性和隔离级别 https://www.cnblogs.com/eunice-sun/p/11024584.html

spring事务传播机制总结 https://blog.csdn.net/m18330808841/article/details/109543815

spring boot @Transactional注解事务不回滚不起作用无效 https://blog.csdn.net/zdyueguanyun/article/details/80236401?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

正文

扫盲示例

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.12.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo-order</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo-order</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.26</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>
</project>

application.properties

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test
spring.datasource.username=root
spring.datasource.password=root

App.java

package com.example.demoorder;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

UserController.java

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private ServiceA serviceA;

    @GetMapping("/a")
    public void a() {
        serviceA.methodA();
    }
}

UserService.java

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {
    @Autowired
    private UserMapper mapper;

    //什么都不写时,默认为Propagation.REQUIRED
    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        int i = 1 / 0;
    }

    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
    }
}

UserMapper.java

package com.example.demoorder;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserMapper {
    @Insert("insert into a (id,name) values (#{id},#{name})")
    public void saveA(@Param("id") Integer id, @Param("name") String name);

    @Insert("insert into b (id,name) values (#{id},#{name})")
    public void saveB(@Param("id") Integer id, @Param("name") String name);
}

ServiceA.java

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    //@Autowired
    //private ServiceB serviceB;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        //serviceB.methodB();
        int i = 1 / 0;
    }
}

ServiceB.java

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
    }
}

测试:浏览器输入 127.0.0.1:8080/a 

a表回滚成功

示例1

Propagation.REQUIRED
1.如果前面的方法已经创建了事务,那么后面的方法加入这个已存在的事务

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a和b表都回滚成功。

2.如果前面的方法没有创建事务,那么后面的方法会新建一个事务.

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现b表回滚成功,但是a表没有回滚。

示例2:Propagation.SUPPORTS
1如果当前存在事务,则加入当前事务

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a和b表都回滚成功。
2如果当前没有事务,就以非事务方法执行

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a和b表都不回滚。

示例3:Propagation.MANDATORY
1当前存在事务,则加入当前事务,

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        methodB();
    }

    @Transactional(propagation = Propagation.MANDATORY)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a和b表都回滚成功。
2如果当前事务不存在,则抛出异常。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.MANDATORY)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a表不回滚,methodB()方法进不来,也不打印methodB字符串。

示例4 : Propagation.REQUIRES_NEW

在执行时,不论当前是否存在事务,总是会新建一个事务。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
        int i = 1 / 0;
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");

    }
}

测试:调用methodA()方法,发现a表回滚,b表插入数据库成功,b表不回滚

示例5 :Propagation.NOT_SUPPORTED

在执行时,不论当前是否存在事务,都会以非事务的方式运行。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a表回滚,b表不回滚

示例6 :Propagation.NEVER

就是我这个方法不使用事务,并且调用我的方法也不允许有事务,如果调用我的方法有事务则我直接抛出异常。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.NEVER)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a表回滚,ServiceB的methodB不执行,不打印methodB字符串

示例7 :Propagation.NESTED

如果当前事务不存在,则像 Propagation.REQUIRED开启一个新事物
如果当前事务存在,则在嵌套事务中执行。嵌套事务一个非常重要的概念就是内层事务依赖于外层事务。外层事务失败时,会回滚内层事务所做的动作。而内层事务操作失败并不会引起外层事务的回滚。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;

    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.NESTED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a表不回滚,b表回滚

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;

    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        try {
            serviceB.methodB();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.NESTED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
        int i = 1 / 0;
    }
}

测试:调用methodA()方法,发现a表不回滚,b表回。因为调用方catch了被调方的异常,所以只有子事务回滚了。

package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceA {
    @Autowired
    private UserMapper mapper;
    @Autowired
    private ServiceB serviceB;
    @Transactional(propagation = Propagation.REQUIRED)
    public void methodA() {
        System.out.println("methodA");
        mapper.saveA(11, "aa");
        serviceB.methodB();
        int i = 1 / 0;
    }
}
package com.example.demoorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ServiceB {
    @Autowired
    private UserMapper mapper;

    @Transactional(propagation = Propagation.NESTED)
    public void methodB() {
        System.out.println("methodB");
        mapper.saveB(22, "bb");
    }
}

测试:调用methodA()方法,发现a表回滚,b表回滚
 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Spring事务传播属性 的相关文章

  • C++输出二进制数

    示例 include
  • Lattice Diamond安装

    1 下载 到Lattice官网 http www latticesemi com 注册一个lattice的账号后就可以去下载Diamond 登陆后如下图 根据自己系统情况选择对应的版本 我用的是32位win8 Diamond软件安装包和La
  • DenseFusion复现-可以在30系/40系显卡运行

    笔者电脑显卡为4060 因为使用DenseFusion作者pytorch1 0的代码没有成功 发现很多人在30系显卡上复现失败 经过查资料后发现是因为cuda版本与显卡算力不匹配 需要提高cuda版本 因此也需要提高pytorch版本 后来
  • vue动态添加style样式

    注意 凡是有 的style属性名都要变成驼峰式 比如font size要变成fontSize 除了绑定值 其他的属性名的值要用引号括起来 比如backgroundColor 00a2ff 而不是 backgroundColor 00a2ff
  • 数据库服务器操作系统升级方案,PostgreSQL 数据库跨版本升级常用方案解析

    大家好 我是只谈技术不剪发的 Tony 老师 对于企业而言 将数据库系统升级到新版本通常可以获得更好的性能 更多的功能 最新的安全补丁和错误修复等 因此 本文就来介绍一下 PostgreSQL 数据库版本升级的 3 种常用方案 升级方案概述
  • Element Plus 实例详解(五)___Scrollbar 滚动条

    Element Plus 实例详解 五 Scrollbar 滚动条 本文目录 一 前言 二 搭建Element Plus试用环境 1 搭建Vue3项目 基于Vite Vue 2 安装Element Plus 三 Element Plus S
  • 讲解+可执行完整代码 C++单链表(2)查找、插入、删除元素

    目录 一 查找元素 代码部分 核心代码 完整代码 二 插入元素 核心思路 代码部分 核心代码 完整代码 编辑 三 删除元素 核心思路 代码部分 核心代码 完整代码 一 查找元素 此段代码仅实现查找元素的功能 代码部分 核心代码 node l
  • 探究 Nginx 中 reload 流程的真相

    点击上方 程序员小乐 关注 星标或置顶一起成长 每天凌晨00点00分 第一时间与你相约 每日英文 Try to hold the right hand with your left hand and gave yourself most s
  • web前端技术笔记(二)html 表单 和页面嵌套

    1 相对路径和绝对路径 2 有序和无序列表 3 表格 4 注册表单 表单用于搜集不同类型的用户输入 表单由不同类型的标签组成 相关标签及属性用法如下 1
  • 基于 Zipkin的链路追踪

    Zipkin介绍 Zipkin 是 Twitter 的一个开源项目 它基于 Google Dapper 实现 它致力于收集服务的定时数据 以 解决微服务架构中的延迟问题 包括数据的收集 存储 查找和展现 我们可以使用它来收集各个服务器 上请
  • 每日一练-仓库日志

    仓库日志 题目描述 解题思路 Python源码 Summary Date 2023年1月9日 Author 小 y 同 学 Classify 蓝桥杯每日一练 Language Python 题目描述 题意 M海运公司最近要对旗下仓库的货物进
  • ST公司 Lis2dh12 三轴加速度传感器,计算加速度值转成角度值

    目录 概述 项目上使用了一款Lis2dh12三轴加速度传感器 开发前要准备的工作 1 原理图 1 1 创建lis2dh12 c文件 1 2 在此重点说明 如果想调传感器的中断灵敏度 注意 关注1 INT1 THS 32h 2 INT1 DU
  • 华为OD机试真题- 任务混部【2023Q1】【JAVA、Python、C++】

    题目描述 公司创新实验室正在研究如何最小化资源成本 最大化资源利用率 请你设计算法帮他们解决一个任务混部问题 有taskNum项任务 每个任务有开始时间 startTime 结束时间 endTime 并行度 parallelism 三个属性
  • 什么是分布式架构

    一 分布式架构定义 什么是分布式架构 分布式系统 distributed system 是建立在网络之上的软件系统 内聚性 是指每一个数据库分布节点高度自治 有本地的数据库管理系统 透明性 是指每一个数据库分布节点对用户的应用来说都是透明的
  • 多处理器编程的艺术(二)-并行程序设计

    当处理器的性能的发展受到各方面因素的限制的时候 计算机产业开始用多处理器结构实现并行计算来提高计算的效率 我们使用多处理器共享存储器的方式实现了多处理器编程 也就是多核编程 当然在这样的系统结构下我们面临着各种各样的挑战 例如如何协调各个处
  • 十四、java版 SpringCloud分布式微服务云架构之Java String 类

    Java String 类 字符串广泛应用 在 Java 编程中 在 Java 中字符串属于对象 Java 提供了 String 类来创建和操作字符串 创建字符串 创建字符串最简单的方式如下 String str xxx 在代码中遇到字符串
  • STM32串口中断、DMA接收的几点注意地方

    STM32串口中断 DMA接收的几点注意地方 https tieba baidu com p 5978431198 red tag 1717231177 traceid 这个文章棒 今天写点大家常问 也是常见的关于UART串口的内容 这几点
  • Ubuntu 18.04安装教程(转)

    https blog csdn net qq 39478237 article details 83084515 参考这个播客安装
  • LAB1实验

    Part 1 遇到问题1 我将JOS放在Windows的目录下 通过VMware设置共享该文件夹来编译JOS 但是Windows更改linux下设置的权限 导致GDB无法调试QEMU 解决方法 将JOS放在虚拟机下的linux的目录下 20
  • Activiti6.0学习实践(5)-activiti流程引擎配置二

    本节继续对activiti流程引擎的配置进行学习 1 EventLog配置 1 1 配置EventLog 首先在activiti eventlog cfg xml中配置eventlog属性为true 1 1 1测试代码 编写一个eventl

随机推荐

  • 推荐111个软件工程本科的计算机毕业设计,有手就会

    对于即将挑战计算机专业毕业设计的学子们 是否已经为选题和项目感到焦虑 今天 我们为即将毕业的学生提供了大量的毕业设计项目 期望对于正在为毕业设计挠头的同学们有所助益 一 成品列表 以下所有springboot框架项目的源码博主已经打包好上传
  • Redis介绍、安装、基础命令

    目录 引言 一 关系数据库和非关系数据库 1 1 关系型数据库 1 2 非关系型数据库 1 3 关系型数据库与非关系型数据库区别 数据存储方式不同 扩展方式不同 对事务性的支持不同 非关系型数据库产生背景 二 Redis简介 2 1 Red
  • 网站打开速度缓慢的原因都有哪些?

    在进行站点优化时 很多站长会发现我们的网站有时运行速度很快 有时运行速度很慢 严重影响了用户体验 因此 有必要理解为什么网站变得很慢 如今 可以帮助你了解为什么我们的网站会慢下来 1 网页的大小 网页加载速度与网页大小直接相关 站点的代码文
  • 2023 最新版IntelliJ IDEA 2023.1创建Java Web 项目详细步骤(图文详解)

    前言 本篇文章仅作为刚开始使用 IntelliJ IDEA 2023 1 创建一个简单的web项目的开发人员 只是作为入门使用 目前很多都是使用spring boot框架来搭建Java的web项目 但是spring boot的最新版本目前
  • C#System.ArgumentException

    C 自定义控件GDI绘制在主程序报错System ArgumentException 我的绘制图片内容大概如下 private Bitmap backGroundImage null private Bitmap prospectImage
  • Java 6-1 项目模块化-概念

    6 1 项目模块化 概念 一 组件化与模块化 组件化 以功能为依据 解决复用问题 初衷 可复用的代码 进行工具性的封装 目的 复用 解耦 依赖 各组件之间独立 低依赖甚至零依赖 架构 纵向 位于项目底层 被其他上层依赖 举例 Dialog
  • 完全数

    my0163 完全数 HOBO浩 描述 求正整数 2 和 n 之间的完全数 一行一个数 完全数 因子之和等于它本身的自然数 如 6 1 2 3 输入 输入n 1 n 5000 输出 一行一个数 按由小到大的顺序 输入样例 7 输出样例 6
  • 自学网络安全(黑客)的误区

    前言 网络安全入门到底是先学编程还是先学计算机基础 这是一个争议比较大的问题 有的人会建议先学编程 而有的人会建议先学计算机基础 其实这都是要学的 而且这些对学习网络安全来说非常重要 一 网络安全学习的误区 1 不要试图以编程为基础去学习网
  • java 二阶段提交,二阶段提交协议(Two Phase Commitment Protocol)

    一 典型的分布式事务实例 跨行转账问题是一个典型的分布式事务 用户A向B的一个转账1000 要进行A的余额 1000 B的余额 1000 显然必须保证这两个操作的事务性 类似的还有 电商系统中 当有用户下单后 除了在订单表插入记 还要在商品
  • mysql数据库常用sql语句

    数据库可以用图形化工具来实现一系列操作 这里涉及一些cmd命令行 首先要配置好环境变量可以全局操作命令 不然只能在mysql的安装目录下进行操作 这里不再叙述 1 进入数据库 mysql u root p 默认用户名为root 这个与mys
  • Flutter 中的单元测试:从工作流基础到复杂场景

    对 Flutter 的兴趣空前高涨 而且早就应该出现了 Google 的开源 SDK 与 Android iOS macOS Web Windows 和 Linux 兼容 单个 Flutter 代码库支持所有这些 单元测试有助于交付一致且可
  • 3种方法更改Linux系统的主机名(hostname)

    3种方法更改Linux系统的主机名 hostname
  • type-aliases-package的作用

    mapper xml文件中resultType或者parameterType会使用JavaBean作为返回结果或者参数需要使用完全限定名来指定引用 例如
  • undefined reference to ceil 链接错误

    undefined reference to ceil 链接错误 原因今天编译一个C文件 输入下面的代码后 GOP12 c文件代码大致为 include
  • 森林的先序和中序遍历

    森林的先序和中序遍历 先序遍历 中序遍历 最靠谱的方法 先序遍历 中序遍历 最靠谱的方法 把森林转为二叉树 左孩子 右兄弟的那种 然后对二叉树进行先序或中序遍历即得正确结果
  • 机器ubuntu20.04和ubuntu16.04在局域网下ros通信

    多台机器ros局域网通信 试过在ubuntu16 04的机器人和ubuntu20 04下安装不同版本ros通信 测试成功 首先保证两台机器在同一个局域网内 可以相互ping通 1 查看ip地址 ifconfig 2 ssh远程登录机器人计算
  • Qt界面制作简单教程,调用python代码

    利用Qt5design或Qt5Creator制作界面的布局 包括设置按钮的个数 布局和大小等 注意记得为每个按钮添加槽函数 保存生成 ui文件 利用pyuic5 xxx ui gt xxx py或pyuic5 xxx ui o xxx py
  • 最全的雅思8000词汇pdf_助力9分

    词汇是雅思学习的基础 对此我们特别设立 9分词汇 小栏目 专门分享词汇相关干货 包括但不限于 高频词解析 场景词汇总结 熟词辟义 同义替换等等 如果你还有其他有关词汇想要学习了解的 欢迎给我们留言 一定及时为大家补充 雅思听力part 1
  • html点击收缩展开菜单栏,jquery实现点击向下展开菜单项(伸缩导航)效果

    本文实例讲述了jquery实现点击向下展开菜单项 伸缩导航 效果 分享给大家供大家参考 具体如下 这里演示基于jquery打造的向下展开的多级导航条效果 纵向垂直排列 风格非常的简洁 鼠标点击时候展开菜单的二级项 再次点击的时候又向上合拢
  • Spring事务传播属性

    参考文献 Spring事务传播属性和隔离级别 https www cnblogs com eunice sun p 11024584 html spring事务传播机制总结 https blog csdn net m18330808841