@internal
(conn: Connection)
| 232 | |
| 233 | /** @internal */ |
| 234 | pin(conn: Connection): void { |
| 235 | if (this.pinnedConnection) { |
| 236 | throw TypeError('Cannot pin multiple connections to the same session'); |
| 237 | } |
| 238 | |
| 239 | this.pinnedConnection = conn; |
| 240 | conn.emit( |
| 241 | PINNED, |
| 242 | this.inTransaction() ? ConnectionPoolMetrics.TXN : ConnectionPoolMetrics.CURSOR |
| 243 | ); |
| 244 | } |
| 245 | |
| 246 | /** @internal */ |
| 247 | unpin(options?: { force?: boolean; forceClear?: boolean; error?: AnyError }): void { |
no test coverage detected