Created
December 21, 2025 03:41
-
-
Save msbaek/f81488307c0346e338f5c7b71b8b77f4 to your computer and use it in GitHub Desktop.
더티 체킹의 함정
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Transactional | |
| public void updateName(Long id, String newName) { | |
| User user = userRepository.findById(id).orElseThrow(); | |
| user.setName(newName); | |
| // 여기서 마법이 일어난다. save() 없이도 DB가 업데이트된다. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment