[ZODB-Dev] [Fixed?] _p_jar magic stopped working

Ross Boylan RossBoylan@stanfordalumni.org
Sat, 10 Aug 2002 17:08:16 -0700


On Sat, Aug 10, 2002 at 08:10:42AM -0400, Jim Fulton wrote:
> >P.S. The docs say _p_jar is None if the object has not been saved,
> 
> Right.
> 
> > but
> >it appears to be a valid Connection even with the object created in
> >the same transaction.
> 
> I think you are mistaken.
> 
> Jim
> 

def manage_CredentialElectorate_add(container, id, title=None, length=8, voters=None, REQUEST=None):
    "Add the indicated electorate"
    electors = CredentialElectorate(id, title, length)
    print electors._p_jar
    container.Destination()._setObject(id, electors)
    print electors._p_jar
    electors.addVotersFromGUI(voters, container.Destination())
    if REQUEST:
        REQUEST.RESPONSE.redirect('manage_main')

The first _p_jar is None, but the second is
<ZODB.Connection.Connection instance at 0x8c4997c>.  So apparently
something in _setObject set this up.