Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass additional data to event handler #107

Open
Diggsey opened this issue Jun 19, 2020 · 1 comment
Open

Pass additional data to event handler #107

Diggsey opened this issue Jun 19, 2020 · 1 comment

Comments

@Diggsey
Copy link

Diggsey commented Jun 19, 2020

I've found the event handler mechanism extremely useful (particularly the Checkin event) but it would be useful to be able to pass additional information when obtaining a connection from the pool to then be accessible to the event handler.

In my case this additional information would be a "transaction name" - so that if our event handler does observe a slow transaction, we can easily observe which transaction was the cause. There are a couple of options I can think of:

  • Have a new method to obtain a connection with a transaction name, and add this name to the event.
  • Make the Extensions type available to event handlers, so that I could add the transaction name as a String after checking out the connection.

The former has the advantage that the transaction name could be available to checkout and checkin events, while the latter would only work for checkin events. However, checkin is more important.

@sunng87
Copy link

sunng87 commented Oct 8, 2021

CustomizeConnection seems to work for this scenario too. However, it does not has access to Extension either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants