Skip to content

Commit

Permalink
DatasourceHealthIndicator consumes all the DB connections from the po…
Browse files Browse the repository at this point in the history
…ol when used with Exposed Spring Boot starter #1077
  • Loading branch information
Tapac committed Oct 24, 2020
1 parent 4ebb38c commit cb29f3f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.Transaction
import org.jetbrains.exposed.sql.statements.api.ExposedConnection
import org.jetbrains.exposed.sql.statements.jdbc.JdbcConnectionImpl
import org.jetbrains.exposed.sql.transactions.DEFAULT_ISOLATION_LEVEL
import org.jetbrains.exposed.sql.transactions.DEFAULT_REPETITION_ATTEMPTS
import org.jetbrains.exposed.sql.transactions.TransactionInterface
import org.jetbrains.exposed.sql.transactions.TransactionManager
Expand Down Expand Up @@ -54,6 +53,9 @@ class SpringTransactionManager(private val _dataSource: DataSource,
if (!TransactionSynchronizationManager.hasResource(_dataSource)) {
TransactionSynchronizationManager.unbindResourceIfPossible(this)
}
if (TransactionSynchronizationManager.isSynchronizationActive() && TransactionSynchronizationManager.getSynchronizations().isEmpty()) {
TransactionSynchronizationManager.clearSynchronization()
}
TransactionManager.resetCurrent(null)
}

Expand Down

0 comments on commit cb29f3f

Please sign in to comment.