Skip to content

Connection state is not reset on return to pool #934

@aikar

Description

@aikar

Per comment on #925 (comment)

This library does not reset the state of a connection returned to the pool before it is reused.

This means if any operation mutates state of the connection such as session level variables/isolation level, or begins a transaction without committing or rolling back, the new connection request is given a dirty connection object.

This can lead to rather extreme bugs.

to resolve this, the library needs to follow the industry standard practice of issuing a connection.changeUser() with the same user the connection was opened with, ensuring that the state is all reset.

I would suggest doing this on connection release rather than connection acquire so that obtaining a connection can be faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions