-
2024.01.14 TransactionSynchronizationManagerTIL 2024. 1. 14. 22:36
TransactionSynchronizationManager
트랜잭션 내부에서 데이터(커넥션등)를 동기화할 때 사용하는 오브젝트인데 이것을 활용하면 내가 원하는 트랜잭션 생명주기와 동일한 캐시를 만들 수 있을 듯 하다.
registerSynchronization 메소드도 제공하는데 before commit등을 정의할 수 있다. 커밋 전에 뭔가를 해야할 때 여기다 넣으면 될 듯 하다.
TransactionSynchronizationManager (Spring Framework 6.1.3 API)
Return whether there currently is an actual transaction active. This indicates whether the current thread is associated with an actual transaction rather than just with active transaction synchronization. To be called by resource management code that wants
docs.spring.io
'TIL' 카테고리의 다른 글
2024.02.23 DLT logging custom (0) 2024.02.23 2024.02.03 spring security Authorization Manager Method Security (0) 2024.02.03 2024.01.02 kafka 적어도 한 번... (0) 2024.01.03 2023.12.16 JMeter,feign (0) 2023.12.16 2023.12.10 MVCC (0) 2023.12.10