jstests/core/txns/libs/prepare_helpers.js
/**
     * Creates a session object on the given connection with the provided 'lsid'.
     *
     * @return {session} the session created.
     */
Creates a session object on the given connection with the provided 'lsid'.
@return {session} the session created.
Creates a session object on the given connection with the provided ' lsid ' . @return { session } the session created .
function createSessionWithGivenId(conn, lsid, sessionOptions = {}) {
        const session = conn.startSession(sessionOptions);
        const oldId = session._serverSession.handle.getId();
        print("Overriding sessionID " + tojson(oldId) + " with " + tojson(lsid) + " for test.");
        session._serverSession.handle.getId = () => lsid;
        return session;
    }
function createSessionWithGivenId ( conn , lsid , sessionOptions = { } ) { const session = conn . startSession ( sessionOptions ) ; const oldId = session . _serverSession . handle . getId ( ) ; print ( "Overriding sessionID " + tojson ( oldId ) + " with " + tojson ( lsid ) + " for test." ) ; session . _serverSession . handle . getId = ( ) => lsid ; return session ; }
Creates a session object on the given connection with the provided 'lsid'.
Creates a session object on the given connection with the provided ' lsid ' .