Skip to content

Commit

Permalink
🐞 BugFix/#175 - refactor: Optimistic Lock 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkyeomjang committed Nov 27, 2024
1 parent 3836163 commit e8d182e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public enum ErrorCode {
TOKEN_GENERATION_ERROR(40106, HttpStatus.UNAUTHORIZED, "토큰 생성에 μ‹€νŒ¨ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
TOKEN_UNKNOWN_ERROR(40107, HttpStatus.UNAUTHORIZED, "μ•Œ 수 μ—†λŠ” ν† ν°μž…λ‹ˆλ‹€."),

// Conflict Error
OPTIMISTIC_EXCEPTION(40900, HttpStatus.CONFLICT, "Optimistic Locking μ˜ˆμ™Έκ°€ λ°œμƒν•˜μ˜€μŠ΅λ‹ˆλ‹€."),

// Internal Server Error
INTERNAL_SERVER_ERROR(50000, HttpStatus.INTERNAL_SERVER_ERROR, "μ„œλ²„ λ‚΄λΆ€ μ—λŸ¬μž…λ‹ˆλ‹€."),
INTERNAL_DATA_ERROR(50001, HttpStatus.INTERNAL_SERVER_ERROR, "μ„œλ²„ λ‚΄λΆ€ 데이터 μ—λŸ¬μž…λ‹ˆλ‹€."),
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/daon/onjung/suggestion/domain/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class Board {
@Column(name = "comment_count", nullable = false)
private Integer commentCount;

@Version // Optimistic Lock μ‚¬μš©
private Long version;

/* -------------------------------------------- */
/* Timestamp Column --------------------------- */
/* -------------------------------------------- */
Expand Down

0 comments on commit e8d182e

Please sign in to comment.