Skip to content
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단계] 이리내(성채연) 미션 제출합니다. #588

Merged
merged 8 commits into from
Oct 12, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ private TransactionSynchronizationManager() {}

@Nullable
public static Connection getResource(final DataSource key) {
return resources.get().getOrDefault(key, null);
return getResources().getOrDefault(key, null);
}

public static void bindResource(final DataSource key, final Connection value) {
resources.get().put(key, value);
getResources().put(key, value);
}

public static Connection unbindResource(final DataSource key) {
return resources.get().remove(key);
return getResources().remove(key);
}

private static Map<DataSource, Connection> getResources() {
return resources.get();

Choose a reason for hiding this comment

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

취향차이일수도 있지만 더 가독성이 올라간 코드가 된것같네욯ㅎ

}
}