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`注解进行事务管理的示例代码如下:
|
||||
|
||||
```java
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||
public void aMethod {
|
||||
//do something
|
||||
B b = new B();
|
||||
@ -277,7 +277,7 @@ public interface TransactionStatus{
|
||||
|
||||
```java
|
||||
Class A {
|
||||
@Transactional(propagation = Propagation.xxx)
|
||||
@Transactional(propagation=propagation.xxx)
|
||||
public void aMethod {
|
||||
//do something
|
||||
B b = new B();
|
||||
@ -286,7 +286,7 @@ Class A {
|
||||
}
|
||||
|
||||
Class B {
|
||||
@Transactional(propagation = Propagation.xxx)
|
||||
@Transactional(propagation=propagation.xxx)
|
||||
public void bMethod {
|
||||
//do something
|
||||
}
|
||||
@ -358,7 +358,7 @@ public enum Propagation {
|
||||
|
||||
```java
|
||||
Class A {
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||
public void aMethod {
|
||||
//do something
|
||||
B b = new B();
|
||||
@ -367,7 +367,7 @@ Class A {
|
||||
}
|
||||
|
||||
Class B {
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||
public void bMethod {
|
||||
//do something
|
||||
}
|
||||
@ -382,7 +382,7 @@ Class B {
|
||||
|
||||
```java
|
||||
Class A {
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||
public void aMethod {
|
||||
//do something
|
||||
B b = new B();
|
||||
@ -391,7 +391,7 @@ Class A {
|
||||
}
|
||||
|
||||
Class B {
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
@Transactional(propagation=propagation.REQUIRES_NEW)
|
||||
public void bMethod {
|
||||
//do something
|
||||
}
|
||||
@ -409,7 +409,7 @@ Class B {
|
||||
|
||||
```java
|
||||
Class A {
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_REQUIRED)
|
||||
public void aMethod {
|
||||
//do something
|
||||
B b = new B();
|
||||
@ -418,7 +418,7 @@ Class A {
|
||||
}
|
||||
|
||||
Class B {
|
||||
@Transactional(propagation = Propagation.NESTED)
|
||||
@Transactional(propagation=propagation.PROPAGATION_NESTED)
|
||||
public void bMethod {
|
||||
//do something
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user