Spring Data JPA Quick Guide
  • Spring Data JPA 快速指南
  • 配置依赖
  • 配置数据源
  • 数据库编码与词语定序
  • Core Concepts
  • 基本用法
  • Transactions
    • 什么是事务
    • 配置事务(@EnableTransactionManagement)
    • 配置事务(XML)
    • 配置事务(@Transactional)
    • @Transactional 实现细节
    • Transaction and Spring Data JPA
    • 事务隔离
    • 事务传播
  • Query Creation from Method Names
  • Using @Query
  • Sorting and Pagination
  • Projection
  • Specification
  • Query by Example
  • javax.persistence Annotations
    • @OneToOne (bidirectional)
      • Usage
      • PO Serialization
      • Save and Update
      • Nested Projection
      • @MapsId
    • @OneToMany (bidirectional)
    • @OneToMany (unidirectional)
    • @ManyToMany (bidirectional)
      • Many-to-Many Using a Composite Key
由 GitBook 提供支持
在本页
  1. Transactions

什么是事务

事务就是逻辑上的一组操作,这组操作要不就全部成功执行,要不就全部不执行。如果事务中间发生错误,系统应当将系统状态回滚到事务发生之前。

事务的特性:ACID

  • Atomicity 原子性

    事务是一组完整的操作,要不就全部成功执行,要不就不执行。

  • Consistency 一致性

    重复的对一组相同的数据执行既定的事务,其结果应当一致。

  • Isolation 事务隔离

    相关错误:脏读、丢失修改、不可重复读、幻读

    隔离程度:读取未提交、读取已提交、可重复读、可序列化

  • Durability 持久性

    事务执行之后做出的修改是永久的。

上一页Transactions下一页配置事务(@EnableTransactionManagement)

最后更新于3年前