Skip to content

Fix: Connection factory should ensure listeners' managedConnectionPostClose() method are invoked when closing managed connection#516

Merged
andyjefferson merged 1 commit into
datanucleus:masterfrom
LennonChin:master
Jul 22, 2026
Merged

Fix: Connection factory should ensure listeners' managedConnectionPostClose() method are invoked when closing managed connection#516
andyjefferson merged 1 commit into
datanucleus:masterfrom
LennonChin:master

Conversation

@LennonChin

@LennonChin LennonChin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

When the ConnectionFactory fails to close the underlying JDBC connection, the thrown exception prevents the listeners' managedConnectionPostClose method from being called. ManagedConnection relies on the managedConnectionPostClose method to remove itself from the ConnectionManager's ConnectionsCache.

Failure to close the underlying JDBC connection may indicate that the underlying connection is corrupted (e.g., disconnected, lost, etc.). Failure to remove ManagedConnection from the ConnectionManager's ConnectionsCache will result in ManagedConnection holding corrupted JDBC connections remaining in the cache, leading to their reuse and subsequent errors.

…tClose() method are invoked when closing managed connection
@andyjefferson andyjefferson added this to the 6.0.12 milestone Jul 22, 2026
@andyjefferson
andyjefferson merged commit e92d74a into datanucleus:master Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants