Seunghoon Choi
@csupreme19
Reviews Written
12
Average Rating
5.0
Posts
Q&A
HikariDataSource๊ฐ ์กด์ฌํ์ง ์๋ ์ด์๊ฐ ์์ต๋๋ค.
์ ๋ ๋ฐ๋ก ์๋์ด์ ํ์ธํด๋ดค๋๋ฐ๊ฐ์ฌ๋์ด ์ฌ์ฉํ์ ์์กด์ฑ์ mavenCentral() ์ ์ฅ์๊ฐ ์๋๋ผ Clojars ์ ์ฅ์์ ์กด์ฌํ๋ค์.https://mvnrepository.com/artifact/hikari-cp/hikari-cp/3.0.1IntelliJ ์ข ์์ฑ ์ถ๊ฐ์ ์ ์ฅ์๊ฐ ์๋ ์ถ๊ฐ๋์ด ํ์ธํ์ง ๋ชปํ ๊ฒ ๊ฐ์ต๋๋ค!์๋ ์ ์ฅ์๋ฅผ ์ถ๊ฐํ์ฌ ์ฌ์ฉํ๊ฑฐ๋repositories { mavenCentral() maven { url "https://clojars.org/repo/" } }๊ธฐ์กด ๋ฉ์ด๋ธ ์ ์ฅ์์ ์กด์ฌํ๋ com.zaxxer:HikariCP ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
- Likes
- 1
- Comments
- 5
- Viewcount
- 2.1K
Q&A
์ปค๋ฅ์ ์ข ๋ฃ
์๋ ํ์ธ์. DataSourceTransactionManager ๊ธฐ์ค์ผ๋ก doCleanupAfterCompletion() ๋ฉ์๋์์ ์งํํ๊ณ ์๋ค์.@Override protected void doCleanupAfterCompletion(Object transaction) { DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; // Remove the connection holder from the thread, if exposed. if (txObject.isNewConnectionHolder()) { TransactionSynchronizationManager.unbindResource(obtainDataSource()); } // Reset connection. Connection con = txObject.getConnectionHolder().getConnection(); try { if (txObject.isMustRestoreAutoCommit()) { con.setAutoCommit(true); } DataSourceUtils.resetConnectionAfterTransaction( con, txObject.getPreviousIsolationLevel(), txObject.isReadOnly()); } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } if (txObject.isNewConnectionHolder()) { if (logger.isDebugEnabled()) { logger.debug("Releasing JDBC Connection [" + con + "] after transaction"); } DataSourceUtils.releaseConnection(con, this.dataSource); } txObject.getConnectionHolder().clear(); }ํธ๋์ญ์ ๋๊ธฐํ ๋งค๋์ ์ ๋ฆฌ์๋ ์ปค๋ฐ โ ์๋ ์ปค๋ฐ ์๋ณต์ปค๋ฅ์ ๋ซ๊ธฐAbstractPlatformTransactionManager ์ถ์ ํด๋์ค processCommit(), processRollback() ๋ฉ์๋์์ ๋ง์ง๋ง์ผ๋ก ๊ฐ ๊ตฌํ์ฒด์ doCleanupAfterCompletion() ๋ฉ์๋๋ฅผ ํธ์ถํ๋ ๊ตฌ์กฐ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
- Likes
- 0
- Comments
- 2
- Viewcount
- 494




