Skip to content

Items are cached forever with no option to refresh #2

Description

@nitzanm

When retrieving an item from a domain using domain[key] for the first time, the item attributes are cached (see Domain.get()). Subsequently when retrieving the same key, you get the object that already exists locally -- the framework doesn't go back to SDB to refresh the data. I see no mechanism to do so except to delete the Domain object and recreate it, which isn't so nice.

Also, there may be a bug if you create an item (using domain[key] on a key that doesn't exist), fill in attributes, and do save(). In some circumstances, I got an empty object back when doing domain[key] later, with no request sent to SDB. In the cases where it happens, it happens consistently, but I didn't drilldown to try and figure out exactly why. A quick look makes me wonder -- in Domain.getitem(), when creating a new Item, why aren't you adding it to self.items? That may be related to the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions