mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-08-01 16:28:03 +08:00
Compare commits
No commits in common. "e9dd66b14f393a3adbe1d22e9f840513101c8ba0" and "9db4b43768319300eaa9ef553759067045159147" have entirely different histories.
e9dd66b14f
...
9db4b43768
@ -127,7 +127,7 @@ public void testTransaction() {
|
|||||||
使用 `@Transactional`注解进行事务管理的示例代码如下:
|
使用 `@Transactional`注解进行事务管理的示例代码如下:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||||
public void aMethod {
|
public void aMethod {
|
||||||
//do something
|
//do something
|
||||||
B b = new B();
|
B b = new B();
|
||||||
@ -277,7 +277,7 @@ public interface TransactionStatus{
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Class A {
|
Class A {
|
||||||
@Transactional(propagation = Propagation.xxx)
|
@Transactional(propagation=propagation.xxx)
|
||||||
public void aMethod {
|
public void aMethod {
|
||||||
//do something
|
//do something
|
||||||
B b = new B();
|
B b = new B();
|
||||||
@ -286,7 +286,7 @@ Class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Class B {
|
Class B {
|
||||||
@Transactional(propagation = Propagation.xxx)
|
@Transactional(propagation=propagation.xxx)
|
||||||
public void bMethod {
|
public void bMethod {
|
||||||
//do something
|
//do something
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ public enum Propagation {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Class A {
|
Class A {
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||||
public void aMethod {
|
public void aMethod {
|
||||||
//do something
|
//do something
|
||||||
B b = new B();
|
B b = new B();
|
||||||
@ -367,7 +367,7 @@ Class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Class B {
|
Class B {
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||||
public void bMethod {
|
public void bMethod {
|
||||||
//do something
|
//do something
|
||||||
}
|
}
|
||||||
@ -382,7 +382,7 @@ Class B {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Class A {
|
Class A {
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||||
public void aMethod {
|
public void aMethod {
|
||||||
//do something
|
//do something
|
||||||
B b = new B();
|
B b = new B();
|
||||||
@ -391,7 +391,7 @@ Class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Class B {
|
Class B {
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
@Transactional(propagation=propagation.REQUIRES_NEW)
|
||||||
public void bMethod {
|
public void bMethod {
|
||||||
//do something
|
//do something
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ Class B {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
Class A {
|
Class A {
|
||||||
@Transactional(propagation = Propagation.REQUIRED)
|
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||||
public void aMethod {
|
public void aMethod {
|
||||||
//do something
|
//do something
|
||||||
B b = new B();
|
B b = new B();
|
||||||
@ -418,7 +418,7 @@ Class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Class B {
|
Class B {
|
||||||
@Transactional(propagation = Propagation.NESTED)
|
@Transactional(propagation=propagation.PROPAGATION_NESTED)
|
||||||
public void bMethod {
|
public void bMethod {
|
||||||
//do something
|
//do something
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user