<tx:advice/> Settings
本节总结了你可以使用 <tx:advice/>
标签指定的各种事务设置。<tx:advice/>
的默认设置如下:
This section summarizes the various transactional settings that you can specify by using
the <tx:advice/>
tag. The default <tx:advice/>
settings are:
-
The propagation setting is
REQUIRED.
-
The isolation level is
DEFAULT.
-
The transaction is read-write.
-
The transaction timeout defaults to the default timeout of the underlying transaction system or none if timeouts are not supported.
-
Any
RuntimeException
triggers rollback, and any checkedException
does not.
你可以更改这些默认设置。下表总结了嵌套于 <tx:advice/>
和 <tx:attributes/>
标签中的 <tx:method/>
标签的各种属性:
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:
Attribute | Required? | Default | Description |
---|---|---|---|
|
Yes |
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, |
|
|
No |
|
Transaction propagation behavior. |
|
No |
|
Transaction isolation level. Only applicable to propagation settings of |
|
No |
-1 |
Transaction timeout (seconds). Only applicable to propagation |
|
No |
false |
Read-write versus read-only transaction. Applies only to |
|
No |
Comma-delimited list of |
|
|
No |
Comma-delimited list of |