[Zope-dev] Problems adding many objects

Morten W. Petersen morten at nidelven-it.no
Mon Sep 26 07:21:12 EDT 2005


Chris,

the implementation looks like this

def manage_add_issue(self, id=None, title='', contents='',
                state='', type='', referrer='', format=None,
                REQUEST=None):
    """Add an Issue."""
    if id is None:
        id = self.get_unique_id()
    issue_ = issue(id, title, contents, state, type,
                   creator=self.get_user().get_id(),
                   owner=self.get_user().get_id(),
                   format=format or
self.get_user_preferences().issue_format)
    self._setObject(id, issue_)
    self.order.append(issue_.id)
    self.order = self.order
    issue_ = self[id]
    issue_.version = self.get_issue_dealer().version
    try:
        self.index_object()
    except AttributeError:
        pass
    if referrer and REQUEST is not None:
        REQUEST.RESPONSE.redirect(referrer)
        print 'redirect'
    else:
        if REQUEST is not None:
            if self.inCMF():
                print 'admin url'
                return self.get_admin_url()
            else:
                print 'manage_main'
                return self.manage_main(self, REQUEST)
        else:
            print 'returning issue', issue_
            return issue_

and before returning none, it says 'returning issue' on stdout.

-Morten

Chris McDonough wrote:
> Hi Morten,
> 
> You'd probably need to show us the implementation of whatever 
> "manage_add_issue" is.
> 
> - C
> 
> 
> On Sep 25, 2005, at 10:09 AM, Morten W. Petersen wrote:
> 
>> Hi,
>>
>> I've created a script that imports XML into the ZODB, using regular  TTW
>> methods - and all is fine, except for when I import large files, with
>> many objects.
>>
>> After about 288 objects, the import fails when the method that adds an
>> object in the ZODB returns None, instead of the object it added.  From
>> what I can tell, the added object is not None before it is  returned, but
>> the name object, set via the expression
>>
>>   object = self.manage_add_issue(...)
>>
>> is None.  So it looks like somewhere between 'return issue_' in
>> manage_add_issue and the expression above, the object is lost.
>>
>> Any ideas what could be happening here?  I've managed to work  around it
>> for now, but it is interesting nonetheless.
>>
>> Regards,
>>
>> Morten
>>
>> <morten.vcf>
>> _______________________________________________
>> Zope-Dev maillist  -  Zope-Dev at zope.org
>> http://mail.zope.org/mailman/listinfo/zope-dev
>> **  No cross posts or HTML encoding!  **
>> (Related lists -
>>  http://mail.zope.org/mailman/listinfo/zope-announce
>>  http://mail.zope.org/mailman/listinfo/zope )
>>
> 
> 


-- 
Regards,

Morten

Tlf:  +47 45 44 00 69
Blog: http://www.blogologue.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: morten.vcf
Type: text/x-vcard
Size: 290 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050926/4e1d64dc/morten.vcf


More information about the Zope-Dev mailing list