Sobes.tech
Junior — Middle

Have you had experience working with Propagation.NESTED in Spring?

sobes.tech AI

Answer from AI

Propagation.NESTED in Spring is a type of transaction behavior where a new transaction is created within an existing one as a nested transaction. Unlike REQUIRES_NEW, the nested transaction uses the same physical connection but has its own savepoint.

If the nested transaction is rolled back, only its part up to the savepoint is rolled back, and the outer transaction can continue and be committed.

Example of usage:

@Transactional(propagation = Propagation.NESTED)
public void nestedMethod() {
    // operations that can be rolled back separately
}

This is useful when you need to partially roll back operations within a large transaction without rolling back the entire transaction.

Have you had experience working with… - sobes.tech