Skip to content

Commit

Permalink
refactor: 트랜잭션 전파수준 설정 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbscks97 authored Aug 22, 2024
1 parent beebb13 commit 2454567
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.UUID;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
Expand Down Expand Up @@ -123,6 +124,7 @@ public PresignedUrlResponse createMissionRecordPresignedUrl(
return PresignedUrlResponse.from(presignedUrl.toString());
}

@Transactional(propagation = Propagation.REQUIRES_NEW)
public ImageUrlResponse uploadCompleteMissionRecord(MissionRecordImageUploadRequest request) {
validateImageFileExtension(request.imageFileExtension());

Expand Down Expand Up @@ -162,6 +164,7 @@ public PresignedUrlResponse createMissionPresignedUrl(MissionImageCreateRequest
return PresignedUrlResponse.from(presignedUrl.toString());
}

@Transactional(propagation = Propagation.REQUIRES_NEW)
public ImageUrlResponse uploadCompleteMission(MissionImageUploadRequest request) {
validateImageFileExtension(request.imageFileExtension());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
Expand Down Expand Up @@ -186,7 +187,7 @@ public MissionTabResponse getMissionTabStatus(Long missionId) {
return new MissionTabResponse(missionRecord.getId(), imageUrl, missionRecordStatus);
}

@Transactional
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void updateMissionRecordWithImage(Long recordId, String imageUrl) {
MissionRecord missionRecord =
missionRecordRepository
Expand Down

0 comments on commit 2454567

Please sign in to comment.