loading objects from ZODB

Discussion in 'Python' started by Achim Domma, Jul 4, 2003.

  1. Achim Domma

    Achim Domma Guest

    Hi,

    I'm playing around with ZODB but I don't understand when objects are loaded
    from the DB. Assume I have an object containing a list of other objects. If
    this object is loaded from ZODB, when is the list filled? Only on demand? I
    think yes, because otherwise reading the top node would result in loading
    the whole database. But I wanted to be sure!

    regards,
    Achim
    Achim Domma, Jul 4, 2003
    #1
    1. Advertising

  2. "Achim Domma" <> a écrit dans le message de news:
    be47oo$621$05$-online.com...
    > Hi,
    >
    > I'm playing around with ZODB but I don't understand when objects are

    loaded
    > from the DB. Assume I have an object containing a list of other objects.

    If
    > this object is loaded from ZODB, when is the list filled? Only on demand?

    I
    > think yes, because otherwise reading the top node would result in loading
    > the whole database. But I wanted to be sure!
    >
    > regards,
    > Achim
    >
    >


    It seems you don't need to care about this. The persistence of objects is
    (almost) transparent.
    You get/set the objects through a transparent cache to the database.
    The only rule : all objects must be picklable, and watch the doc about
    _v_xxx and p_xxx attributes.

    --Gilles
    Gilles Lenfant, Jul 4, 2003
    #2
    1. Advertising

  3. Achim Domma

    John J. Lee Guest

    "Gilles Lenfant" <> writes:

    > "Achim Domma" <> a écrit dans le message de news:
    > be47oo$621$05$-online.com...
    > > I'm playing around with ZODB but I don't understand when objects are loaded
    > > from the DB. Assume I have an object containing a list of other objects. If
    > > this object is loaded from ZODB, when is the list filled? Only on demand? I
    > > think yes, because otherwise reading the top node would result in loading
    > > the whole database. But I wanted to be sure!


    BTrees (OOBTree, IOBTree, OITree, IITree) load contained objects on
    demand, most other data structures (including PersistentList and
    PersistentMapping) don't.


    > It seems you don't need to care about this. The persistence of objects is
    > (almost) transparent.
    > You get/set the objects through a transparent cache to the database.
    > The only rule : all objects must be picklable, and watch the doc about
    > _v_xxx and p_xxx attributes.


    That's not the only rule. Documentation is thin, of course. Andrew
    Kuchling's intro is required reading, as is Jim Fulton's (though the
    latter is particularly out of date, IIRC). There is some useful info
    on BTrees and associated data structures on the Zope wiki.


    John
    John J. Lee, Jul 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. drs

    More ZEO/ZODB issues

    drs, Jul 12, 2003, in forum: Python
    Replies:
    0
    Views:
    326
  2. Diez B. Roggisch

    zodb troubles - seeking advice for app design

    Diez B. Roggisch, May 6, 2004, in forum: Python
    Replies:
    3
    Views:
    347
    Dieter Maurer
    May 7, 2004
  3. Matteo Merli

    ZODB revision

    Matteo Merli, Jul 4, 2004, in forum: Python
    Replies:
    1
    Views:
    270
    Thomas Guettler
    Jul 6, 2004
  4. Gary

    ZODB and Boa

    Gary, Oct 13, 2004, in forum: Python
    Replies:
    4
    Views:
    522
  5. TheIvIaxx

    Get objects from ZODB into MySQL

    TheIvIaxx, Apr 27, 2009, in forum: Python
    Replies:
    3
    Views:
    1,025
    William Heymann
    Apr 28, 2009
Loading...

Share This Page