<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Justin,<div><br></div><div>I tried to reproduce what you describe here but failed at it.</div><div>I think you need to give us a little more information on what kind</div><div>of objects you try to create, what fields they got and (if possible)</div><div>an easy to reproduce testscript.</div><div><br></div><div>i tried something along the lines of:</div><div><br></div><div>>>> storage = []</div><div><div>>>> for i in xrange(1000):</div><div>>>> obj = Test(u'testing name %i' % i)</div><div>>>> storage.append(obj)</div><div>>>> print [store.add(obj).name for obj in storage]</div><div><br></div><div>whereas Test() is a very basic storm object - and it works like a charm</div><div><br></div><div>regards,</div><div>- Andreas Kopecky</div><div><br></div><div><div>Am 24.11.2008 um 01:32 schrieb Justin Warren:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi folks,<br><br>I've hit a weird problem that is beyond me at the moment. Hopefully<br>someone else can shed some light on the situation.<br><br>I create a bunch of objects, and attempt to add them all to the<br>database. If I only add about 100 objects, everything works fine. If I<br>attempt to add 150, I get a bunch of these errors:<br><br>Exception exceptions.AttributeError: AttributeError("'NoneType' object<br>has no attribute 'dumps'",) in <bound method<br>ObjectInfo._emit_object_deleted of {'store': <storm.store.Store object<br>at 0x139cc90>, 'primary_vars': (<storm.variables.IntVariable object at<br>0x1535910>, <storm.variables.DateTimeVariable object at 0x13bcc68>)}<br><br>'dumps' appears to only be used in variables.py as part of<br>pickle.dumps() calls. I added some print statements to get an idea of<br>what's going on, and narrowed the issue to ListVariable.get_state(). It<br>seems that pickle == None within this method, even though the 'import<br>cPickle as pickle' statement at the start of the file works to begin<br>with.<br><br>I've checked my environment, and I can indeed import cPickle. I added an<br>import statement just before the problem line, thus:<br><br> def get_state(self):<br> try:<br> import cPickle as pickle<br> return (self._lazy_value, pickle.dumps(self._value, -1))<br> except AttributeError, e:<br> print "erk! found the problem here."<br> print "pickle is:", pickle<br><br>And then I get this:<br>Exception exceptions.ImportError: ImportError('No module named<br>cPickle',) in <bound method ObjectInfo._emit_object_deleted of {'store':<br><storm.store.Store object at 0x139bc90>, 'primary_vars':<br>(<storm.variables.IntVariable object at 0x151c850>,<br><storm.variables.DateTimeVariable object at 0x13a8fc8>)}><br><br>It seems something is resetting pickle to None, as well as sys.path.<br>This seems really weird to me.<br><br>I'm using Thomas's twisted integration branch r214, and I've seen this<br>same issue in r207. It might be that the twisted integration is breaking<br>something, but I've searched for 'pickle' in all the code files and<br>found nothing. Nor can I find anything obviously updating sys.path.<br><br>Any clues, hints or help would be greatly appreciated.<br><br>-- <br>Justin Warren <<a href="mailto:daedalus@eigenmagic.com">daedalus@eigenmagic.com</a>><br><br><br>-- <br>storm mailing list<br><a href="mailto:storm@lists.canonical.com">storm@lists.canonical.com</a><br>Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/storm">https://lists.ubuntu.com/mailman/listinfo/storm</a><br><br></div></blockquote></div><br></div></body></html>