Skip to content

Commit

Permalink
[MODIFY] user signup 트랜잭션 추가 및 전파 속성 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongJongHo committed Feb 27, 2024
1 parent fdd8319 commit 367a8ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class UserFacadeImpl implements UserFacade{
private final UserService userService;
private final UserNotificationSettingService userNotificationSettingService;
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Transactional
public void signUpUserAndCreateNotificationSetting(UserSignUpDto userSignUpDto) {
userService.signUp(userSignUpDto);
User user = userService.getUser(userSignUpDto.getUsername());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Optional;
Expand All @@ -19,7 +20,7 @@ public class UserServiceImpl implements UserService {

private final UserRepository userRepository;
@Override
@Transactional
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void signUp(UserSignUpDto userSignUpDto) {
userRepository.findOneByUsername(userSignUpDto.getUsername())
.ifPresent((user)-> {
Expand Down

0 comments on commit 367a8ee

Please sign in to comment.