MCPcopy
hub / github.com/mongodb/node-mongodb-native / connectionIsStale

Function connectionIsStale

src/sdam/server.ts:565–573  ·  view source on GitHub ↗
(pool: ConnectionPool, connection: Connection)

Source from the content-addressed store, hash-verified

563}
564
565function connectionIsStale(pool: ConnectionPool, connection: Connection) {
566 if (connection.serviceId) {
567 return (
568 connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString())
569 );
570 }
571
572 return connection.generation !== pool.generation;
573}
574
575function inActiveTransaction(session: ClientSession | undefined, cmd: Document) {
576 return session && session.inTransaction() && !isTransactionCommand(cmd);

Callers 1

decorateCommandErrorMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected