[ZODB-Dev] Commit seems to succeed but does'nt

Christian Robottom Reis kiko@async.com.br
Wed, 26 Sep 2001 12:57:47 -0300 (BRT)


On Wed, 26 Sep 2001, Cyril Elkaim wrote:

> 	Thanks. It seems that we'll go back to PostgreSQL for what we want. We
> have to many objects with too many relations between them. If we must
> create a Mapping for each type... SQL do that already and we know very
> well how to create this kind of stuff :-)

You don't need a Mapping for each type; not exactly, at least. Still, you
do need a way to refer to the instances you are storing so you can get
them back later.

I think you haven't yet understood the real benefit the ZODB offers, which
is transparent persistence in Python (avoiding embedding SQL, which IMHO
is something of a hack). The downside is that you need to make your
retrieval facility yourself, since none if offered beyond the root
mapping.

For simple applications, you could get away with named mappings referring
to your top-level object collections; however, this is very
domain-specific and without understanding your domain, I would be hard
pressed to suggesting how to organize your persistence mechanism.

As a bynote, the cool part is really the transparency and how it fits in
nicely with Python's instance/class semantics. Being able to save stuff
just subclassing, instantiating and doing get_transaction().commit() is
almost too good to be true.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL