This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Framework 6.2.0!spring-doc.cn

<tx:advice/> Settings

This section summarizes the various transactional settings that you can specify by using the <tx:advice/> tag. The default <tx:advice/> settings are:spring-doc.cn

You can change these default settings. The following table summarizes the various attributes of the <tx:method/> tags that are nested within <tx:advice/> and <tx:attributes/> tags:spring-doc.cn

Table 1. <tx:method/> settings
Attribute Required? Default Description

namespring-doc.cn

Yesspring-doc.cn

Method names with which the transaction attributes are to be associated. The wildcard (*) character can be used to associate the same transaction attribute settings with a number of methods (for example, get*, handle*, on*Event, and so forth).spring-doc.cn

propagationspring-doc.cn

Nospring-doc.cn

REQUIREDspring-doc.cn

Transaction propagation behavior.spring-doc.cn

isolationspring-doc.cn

Nospring-doc.cn

DEFAULTspring-doc.cn

Transaction isolation level. Only applicable to propagation settings of REQUIRED or REQUIRES_NEW.spring-doc.cn

timeoutspring-doc.cn

Nospring-doc.cn

-1spring-doc.cn

Transaction timeout (seconds). Only applicable to propagation REQUIRED or REQUIRES_NEW.spring-doc.cn

read-onlyspring-doc.cn

Nospring-doc.cn

falsespring-doc.cn

Read-write versus read-only transaction. Applies only to REQUIRED or REQUIRES_NEW.spring-doc.cn

rollback-forspring-doc.cn

Nospring-doc.cn

Comma-delimited list of Exception instances that trigger rollback. For example, com.foo.MyBusinessException,ServletException.spring-doc.cn

no-rollback-forspring-doc.cn

Nospring-doc.cn

Comma-delimited list of Exception instances that do not trigger rollback. For example, com.foo.MyBusinessException,ServletException.spring-doc.cn