Spring 注解@Transactional

@Transactional 可配置属性


Property Type Description
value String Optional qualifier specifying the transaction manager to be used.
propagation enum: Propagation Optional propagation setting.
isolation enum: Isolation Optional isolation level.
readOnly boolean Read/write vs. read-only transaction
timeout int (in seconds granularity) Transaction timeout.
rollbackFor Array of Class objects, which must be derived fromThrowable. Optional array of exception classes that must cause rollback.
rollbackForClassname Array of class names. Classes must be derived fromThrowable. Optional array of names of exception classes that must cause rollback.
noRollbackFor Array of Class objects, which must be derived fromThrowable. Optional array of exception classes that must not cause rollback.
noRollbackForClassname Array of String class names, which must be derived fromThrowable. Optional array of names of exception classes that must notcause rollback.


propagation: 指定事務定義中使用的傳播

isolation: 指定事務的隔離級別

timeout: 超時時間

readonly : 如果為true, 事務標致為只讀

noRollbackFor: 目標方法可拋出的異常所構成的數組,但通知仍會提交事務

rollbackFor: 異常所構成的數組,如果目標方法拋出了這些異常,通知就會回滾

你可能感兴趣的:(transactional)