-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Yurx opened SPR-17559 and commented
Method doGetConnection in org.springframework.jdbc.datasource.DataSourceUtils has code that leaks (or has potential to leak) resources.
Objects like logger, DataSource, Connection, etc are used or expected to be referenced between the connection is created and returned. Use of those objects can raise exceptions and cause a connection to be created but not returned from the function. This prevents the caller from being able to release that connection.
The solution is simple and quite standard - try/catch clause is needed, see attachment.
This affects all recent versions including 5.0.x and 5.1.x
Affects: 5.0.11, 5.1.3
Attachments:
Metadata
Metadata
Assignees
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug