lib/mongo/session/server_session.rb in mongo-2.5.3 vs lib/mongo/session/server_session.rb in mongo-2.6.0
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2017 MongoDB, Inc.
+# Copyright (C) 2017-2018 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -36,19 +36,24 @@
# The last time the server session was used.
#
# @since 2.5.0
attr_reader :last_use
+ # The current transactions number.
+ #
+ # @since 2.5.0
+ attr_reader :txn_num
+
# Initialize a ServerSession.
#
# @example
# ServerSession.new
#
# @since 2.5.0
def initialize
set_last_use!
session_id
- @txn_num = -1
+ @txn_num = 0
end
# Update the last_use attribute of the server session to now.
#
# @example Set the last use field to now.