diff --git a/src/main/java/me/snaptime/snap/service/impl/SnapServiceImpl.java b/src/main/java/me/snaptime/snap/service/impl/SnapServiceImpl.java index 44337b87..6df716d6 100644 --- a/src/main/java/me/snaptime/snap/service/impl/SnapServiceImpl.java +++ b/src/main/java/me/snaptime/snap/service/impl/SnapServiceImpl.java @@ -25,6 +25,7 @@ import me.snaptime.user.repository.UserRepository; import me.snaptime.util.EncryptionUtil; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.crypto.SecretKey; @@ -220,6 +221,7 @@ public byte[] downloadPhotoFromFileSystem(String fileName, String userEmail, boo return photoData; } + @Transactional @Override public void relocateSnap(Long snapId, Long albumId, String userEmail) { Snap foundSnap = snapRepository.findById(snapId).orElseThrow(() -> new CustomException(ExceptionCode.SNAP_NOT_EXIST));