-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JDBC 라이브러리 구현하기 - 4단계] 이레(이다형) 미션 제출합니다. #553
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f82dc21
feat: TransactionSynchronizationManager 리소스 bind, unbind, get 기능 추가
zillionme be773f8
feat: 커넥션 해제 시, 쓰레드 로컬에 저장된 커넥션 제거
zillionme db74c8e
refactor: 쓰레드 로컬을 통한 커넥션 동기화 적용
zillionme d6af471
refactor: UserService 인터페이스 생성
zillionme a308b22
feat: 결과 있는 트랜잭션 실행 기능 추가
zillionme cbeda5a
feat: AppUserService의 트랜잭션 프록시 클래스 추가
zillionme df0bddc
test: 테스트 수정
zillionme b8bcbe5
chore: 예외 클래스 패키지 이동
zillionme 3b7869f
test: aop 테스트
zillionme 9470118
chore: final 키워드 수정 및 필요없는 메서드 지우기
zillionme a7b16bb
chore: 필요없는 클래스 삭제
zillionme 046b3c8
refactor: 커넥션의 트랜잭션 active 상태에 따른 커넥션 해제 방법 수정
zillionme 8cf6bda
refactor: TransactionManager 트랜잭션 시작과 종료 관리 기능 추가
zillionme 2bfef4b
refactor: JdbcTemplate 커넥션 해제 기능 추가
zillionme 8cf2002
fix: 트랜잭션 동기화 매니저 unbind에 스레드 로컬에 대한 자원 해제 기능 추가
zillionme 237a3a3
refactor: 트랜잭션 매니저에서 발생하는 SQL예외 처리방법 수정
zillionme 6d05798
refactor: 중복 코드 제거
zillionme b2a6103
chore: 주석 제거
zillionme 22da3a4
refaco: 트랜잭션 동기화 매니저 unbind에 스레드 로컬에 대한 자원 해제 기능 추가
zillionme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
jdbc/src/main/java/org/springframework/transaction/support/ConnectionHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.springframework.transaction.support; | ||
|
||
import java.sql.Connection; | ||
|
||
public class ConnectionHolder { | ||
|
||
private final Connection connection; | ||
|
||
private boolean isConnectionTransactionActive; | ||
|
||
public ConnectionHolder(final Connection connection) { | ||
this.connection = connection; | ||
} | ||
|
||
public void setConnectionTransactionActive(boolean isActive) { | ||
this.isConnectionTransactionActive = isActive; | ||
} | ||
|
||
public Connection getConnection() { | ||
return connection; | ||
} | ||
|
||
public boolean isConnectionTransactionActive() { | ||
return isConnectionTransactionActive; | ||
} | ||
} |
15 changes: 7 additions & 8 deletions
15
.../main/java/org/springframework/transaction/support/TransactionSynchronizationManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성자에서도 따로 값을 받지 않고 있는데, default값을 설정해주는 것이 어떨까요?
지금과 같은 경우 setter를 사용하지 않으면 값이 할당되지 않을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean은 기본형이기 때문에 false가 기본값으로 설정되는 것으로 알고 있습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 그러네요.. 죄송합니다..ㅎㅎ
제안드리고 싶었던 점은 기본 값을 false로 명시해두고,
setter(false)
를 이용하지 않는 방법이 더 좋아보여서 말씀드렸습니다!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 그렇게 수정하겠숩니다!