Pass additional data to event handler
Diggsey opened this issue · 1 comments
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.
CustomizeConnection
seems to work for this scenario too. However, it does not has access to Extension
either.