Skip to content

Conversation

@2anizirong
Copy link
Member

#️⃣연관된 이슈

ex) #187

📝작업 내용

  • 로그인 기능에서 발생하던 서버 500 에러 문제 해결
  • JPA 쿼리 파라미터에 @param 어노테이션을 추가하여 명명된 파라미터 문제 수정
  • 서비스 메서드에 @transactional 어노테이션을 붙여 트랜잭션 문제 해결

@2anizirong 2anizirong self-assigned this Aug 20, 2025
@2anizirong 2anizirong added the 🐛 Bug 버그가 발생했을 때 label Aug 20, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @2anizirong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 로그인 기능에서 발생하던 서버 500 에러를 해결하고, JPA 쿼리 파라미터 및 트랜잭션 관련 문제를 수정합니다. 이는 사용자 로그인 경험을 개선하고 데이터 일관성을 보장하는 데 중점을 둡니다.

Highlights

  • 로그인 기능 개선: 로그인 시 발생하던 서버 500 에러를 해결했습니다.
  • JPA 쿼리 파라미터 수정: JPA 쿼리에서 명명된 파라미터 문제를 해결하기 위해 @param 어노테이션을 추가했습니다.
  • 트랜잭션 관리 강화: 서비스 메서드에 @transactional 어노테이션을 추가하여 트랜잭션 관련 문제를 해결하고 데이터 일관성을 확보했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

안녕하세요. PR을 잘 검토했습니다. 로그인 기능에서 발생하던 500 에러와 JPA 쿼리 파라미터 문제를 해결하기 위한 변경 사항들을 확인했습니다.

UserRepository@Param 어노테이션을 추가하여 JPQL 쿼리의 파라미터 바인딩을 명시적으로 만든 것은 좋은 수정입니다.

UserServiceImpl@Transactional 어노테이션을 클래스 레벨에 추가하여 트랜잭션 문제를 해결하셨습니다. 이와 관련하여 읽기 전용 메서드의 성능 최적화를 위한 제안을 리뷰 댓글로 남겼으니 확인 부탁드립니다.

전반적으로 버그를 수정하고 코드 안정성을 높이는 좋은 변경이라고 생각합니다.

import static EatPic.spring.global.common.code.status.ErrorStatus.*;

@Service
@Transactional

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

클래스 전체에 @Transactional을 적용하면 모든 public 메서드가 트랜잭션 내에서 실행되도록 보장할 수 있어 좋습니다. 하지만 이 클래스에는 읽기 전용(read-only) 메서드도 다수 포함되어 있습니다. 이 메서드들까지 기본적으로 read-write 트랜잭션으로 실행되어 성능에 미미한 손해를 볼 수 있습니다.

더 나은 접근 방식은 클래스 레벨에는 @Transactional(readOnly = true)를 선언하여 기본적으로 모든 메서드를 읽기 전용 트랜잭션으로 만들고, 데이터 변경이 필요한 쓰기 메서드(예: signup, loginUser, blockUser 등)에만 @Transactional 어노테이션을 개별적으로 붙여주는 것입니다.

이렇게 하면 코드의 의도가 더 명확해지고 읽기 작업에 대한 성능 최적화도 기대할 수 있습니다.

Suggested change
@Transactional
@Transactional(readOnly = true)

@2anizirong 2anizirong merged commit 4b92c76 into main Aug 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug 버그가 발생했을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] refresh token 재발급 pr 머지 후 로그인 500 에러 오류

2 participants