transaction

open override fun <R> transaction(propagation: Propagation, block: () -> R): R

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-starter as an example, it is the SpringConnectionManager which 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