transaction
abstract fun <R> transaction(propagation: Propagation = Propagation.REQUIRED, block: () -> R): R
Content copied to clipboard
Execute a transaction by the specified Propagation behavior
If an IOC framework is used, its implementation should be an encapsulation of the transaction management within the IOC framework. Taking
jimmer-spring-starteras an example, it is theSpringConnectionManagerwhich will be created and enabled automatically.If no IOC framework is used, the class AbstractTxConnectionManager is the lightweight implementation provided by jimmer, please specify the connection manager of sqlClient by ConnectionManager.simpleConnectionManager
Return
The result of transaction
Parameters
propagation
The propagation behavior
block
The action to be executed in transaction