Skip to content

Commit

Permalink
fix: 트랜잭션 동기화 매니저 unbind에 스레드 로컬에 대한 자원 해제 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
zillionme committed Oct 11, 2023
1 parent 2bfef4b commit 8cf2002
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void bindResource(DataSource key, ConnectionHolder value) {

public static ConnectionHolder unbindResource(DataSource key) {
Map<DataSource, ConnectionHolder> map = resources.get();
if (map == null || !map.containsKey(key)) {
if (map.isEmpty() || !map.containsKey(key)) { // 새로 추가된 코드: map이 비어있다면, 스레드 로컬에서 Map<DataSource, ConnectionHolder> 객체를 삭제
return null;
}
return map.remove(key);
Expand Down

0 comments on commit 8cf2002

Please sign in to comment.