docs: def commit(self):
          """Commit current transaction."""
          if (not self._add_cache and
                  not self._remove_cache and
                  not self._undefined_cache):
              return
  
          for store_key, hash_values in self._add_cache.items():
              for hash_value in hash_values:
                  super(TransactionalIndex, self).add_hashed_value(
                      hash_value, store_key)
          for store_key in self._remove_cache:
              super(TransactionalIndex, self).remove_key(store_key)
          for store_key in self._undefined_cache:
              super(TransactionalIndex, self).add_undefined(store_key)
          if not self.ephemeral:
              self.save_to_store()
  
          self._init_cache()
          self._in_transaction = True