(callback mysql.ResultSpoolFn, modifiers ...ResultModifier)
| 43 | |
| 44 | func (h *MyHandler) ConnectionClosed(c *mysql.Conn) { |
| 45 | var expectedConn *stdsql.Conn |
| 46 | var expectedTx *stdsql.Tx |
| 47 | if h != nil && h.provider != nil && h.provider.Pool() != nil && c != nil { |
| 48 | expectedConn, expectedTx = h.provider.Pool().GetTxnBindingForRelease(c.ConnectionID) |
| 49 | } |
| 50 | // Let GMS remove the session first. Its LifecycleAwareSession callback |
| 51 | // (SessionEnd) must still see the generic pool connection while it rolls back |
| 52 | // a logical autocommit transaction and performs any same-connection cleanup; |
| 53 | // closing the pool entry first could make that cleanup acquire and strand a |
| 54 | // replacement connection. The final pool close then retires the exact entry. |
| 55 | if h != nil && h.Handler != nil { |
| 56 | h.Handler.ConnectionClosed(c) |
| 57 | } |
no outgoing calls
no test coverage detected