Class: Aws::SessionStore::DynamoDB::Locking::Pessimistic

Inherits:
Base
  • Object
show all
Defined in:
lib/aws/session_store/dynamo_db/locking/pessimistic.rb

Overview

This class implements a pessimistic locking strategy for the DynamoDB session handler. Sessions obtain an exclusive lock for reads that is only released when the session is saved.

Instance Method Summary collapse

Methods inherited from Base

#delete_session, #handle_error, #initialize, #pack_data

Constructor Details

This class inherits a constructor from Aws::SessionStore::DynamoDB::Locking::Base

Instance Method Details

#get_session_data(env, sid) ⇒ Object

Gets session from database and places a lock on the session while you are reading from the database.



13
14
15
16
17
# File 'lib/aws/session_store/dynamo_db/locking/pessimistic.rb', line 13

def get_session_data(env, sid)
  handle_error(env) do
    get_session_with_lock(env, sid)
  end
end

#set_session_data(env, sid, session, options = {}) ⇒ Object

Saves the session.



7
8
9
# File 'lib/aws/session_store/dynamo_db/locking/pessimistic.rb', line 7

def set_session_data(env, sid, session, options = {})
  super(env, sid, session, set_lock_options(env, options))
end