Spring tx模块

Spring tx模块

PlatformTransactionManager

1
2
3
4
5
6
7
8
9
10
11
public interface PlatformTransactionManager {
TransactionStatus getTransaction(@Nullable TransactionDefinition var1) throws TransactionException;

void commit(TransactionStatus var1) throws TransactionException;

void rollback(TransactionStatus var1) throws TransactionException;
}

public interface ResourceTransactionManager extends PlatformTransactionManager {
Object getResourceFactory();
}

多种数据库的事务处理逻辑

image-20230423092511385

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public interface TransactionDefinition {
int PROPAGATION_REQUIRED = 0;
int PROPAGATION_SUPPORTS = 1;
int PROPAGATION_MANDATORY = 2;
int PROPAGATION_REQUIRES_NEW = 3;
int PROPAGATION_NOT_SUPPORTED = 4;
int PROPAGATION_NEVER = 5;
int PROPAGATION_NESTED = 6;
int ISOLATION_DEFAULT = -1;
int ISOLATION_READ_UNCOMMITTED = 1;
int ISOLATION_READ_COMMITTED = 2;
int ISOLATION_REPEATABLE_READ = 4;
int ISOLATION_SERIALIZABLE = 8;
int TIMEOUT_DEFAULT = -1;
}
1
2
3
4
5
6
public interface TransactionAttribute extends TransactionDefinition {
@Nullable
String getQualifier();

boolean rollbackOn(Throwable var1);
}

image-20230423092725151


Spring tx模块
http://example.com/2023/06/01/Spring家族/Spring tx/
作者
where
发布于
2023年6月1日
许可协议