Method: PEROBS::Cache#reset

Defined in:
lib/perobs/Cache.rb

#resetObject

Clear all cached entries. You must call flush before calling this method. Otherwise unwritten objects will be lost.



207
208
209
210
211
212
213
214
215
# File 'lib/perobs/Cache.rb', line 207

def reset
  # The read and write caches are Arrays. We use the _bits_ least
  # significant bits of the PEROBS::ObjectBase ID to select the index in
  # the read or write cache Arrays.
  @reads = ::Array.new(2 ** @bits)
  @writes = ::Array.new(2 ** @bits)
  @transaction_stack = ::Array.new
  @transaction_objects = ::Hash.new
end