Spring Transaction on server shutdown

121 Views Asked by At

Spring @Transaction does not rollback if the server shuts down in the middle of a transactional method. But that violates the atomicity principle of transactions. Why is that?

That is, if my code looks like this:

@Transactional
public void method() {
    write();
    // server shuts down
    write();
}

The first write is not rolled back.

0

There are 0 best solutions below