The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MongoDB::_ServerSession - MongoDB Server Session object

VERSION

version v1.999.0

SYNOPSIS

    use MongoDB::_ServerSession;

    my $server_session = MongoDB::_ServerSession->new;

DESCRIPTION

This class encapsulates the session id and last use of the session. For use with MongoDB::ClientSession for session based operations.

ATTRIBUTES

session_id

    $server_session->session_id;

Returns the session id for this server session as a BSON::Bytes object containing a binary UUID V4. For lower network usage, if not provided on initialisation this class will generate a new UUID instead of consulting the server for a new session id.

last_use

    $server_session->last_use;

Returns the unix time that this server session was last used. Used for checking expiry of a server session. If undefined, then the session has (probably) not been used on the server.

transaction_id

    $server_session->transaction_id

Returns the current transaction id for this server session. This is a ratcheted incrementing ID number, which when combined with the session id allows for retrying transactions in the correct order.

METHODS

update_last_use

    $server_session->update_last_use;

Updates the value of "last_use" to the current unix time.

AUTHORS

  • David Golden <david@mongodb.com>

  • Rassi <rassi@mongodb.com>

  • Mike Friedman <friedo@friedo.com>

  • Kristina Chodorow <k.chodorow@gmail.com>

  • Florian Ragwitz <rafl@debian.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by MongoDB, Inc.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004