@Transactional

@Transactional delimits a transaction around a method: if it ends normally, the changes are committed; on an unchecked exception (RuntimeException), they are rolled back. It is applied on the service layer. readOnly = true flags reads, and an internal call to a method of the same class bypasses the proxy.

Example

@Transactional
void virer(long de, long vers, double m) {...}

Related concepts

The whole glossary