Object info checkpoint method in c extensions behaves differently than Python code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
When using the Object info c extensions, the checkpoint method seems to behave differently whether the c extensions are being used than the pure Python code. This can be observed by deriving the Property class, then updating properties of the corresponding object on __get__ and finally calling checkpoint(). Afterwards, it seems that the properties are not really checkpointed so that the next flush operation actually updates all the properties modified prior to the checkpoint. Here is an example that demonstrates the problem:
class Cache(Property):
def __get__(self, obj, cls=None):
if obj is not None:
return Property.
class CacheType(object):
...
def do_copy(self, other):
obj_info = get_obj_info(self)
cls = obj_info.
for attr, _descr in self._cache_
if not _descr._other_name:
value = getattr(other, _descr._other_name)
# Avoid calling Cache.__set__
# Checkpoint the state of the remote object
def do_update(self):
# Update object if remote is accessible
if self.other is not None:
Changed in storm: | |
status: | New → Incomplete |
Could you provide a self contained example? I don't have a good idea of what you're trying to do here, or why you're calling checkpoint().
The purpose of checkpoint() is to indicate that the value stored in the Variable instance matches that of the database. It isn't clear from the code snippet you've posted that this is the case
Looking at the code for the checkpoint methods, the cextensions versions look correct.