Skip to content

Spring does not clean up db connection registered in afterCompletion callback [SPR-15194] #19759

@spring-projects-issues

Description

@spring-projects-issues

M J opened SPR-15194 and commented

During rollback, when additional database operations are performed using jdbcTemplate, Spring does not clean up the database connection it stores in threadLocal.

When the same thread is later reused on another request, Spring uses this stale and potential invalid ( terminated by server) connection, instead of getting one from the thread pool. This causes "broken pipe" or "communication link failure" exception

See this link for detailed example

http://stackoverflow.com/questions/41860231/springframework-jdbctemplate-database-connection-not-cleanedup-from-threadloca


Affects: 4.2.6

Reference URL: http://stackoverflow.com/questions/41860231/springframework-jdbctemplate-database-connection-not-cleanedup-from-threadloca

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions