Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items are cached forever with no option to refresh #2

Open
nitzanm opened this issue Jul 27, 2010 · 1 comment
Open

Items are cached forever with no option to refresh #2

nitzanm opened this issue Jul 27, 2010 · 1 comment

Comments

@nitzanm
Copy link

nitzanm commented Jul 27, 2010

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.

@mdornseif
Copy link

You might wan to check benslavin's branch at http://github.com/benslavin/python-simpledb/commits/ - he has worked on the caching issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants