[ZODB-Dev] ZODB head deprecation warnings

Casey Duncan casey at zope.com
Sun Feb 29 00:34:34 EST 2004


I noticed the addition of the add() method to the zodb connection
interface so I decided to start using it in places where I had been
assigning to _p_jar. After upgrading to ZODB head, I got the deprecation
warning for assigning to _p_jar which was unsurprising. What was
surprising was that I continued to get it after I converted all the code
to use conn.add(obj) instead.

Interestingly the deprecation warning happens when the zodb root object
is registered with the connection in my tests. The code in
Connection.register issues the warning if the object being registered
already has an oid. I think this actually should be the other way
around, IOW it should issue the warning if the object *does not* have an
oid, right? I changed the test in line 637 in Connection.py and the
warning goes away.

I also get a warning about "cache_deactivate_after has no effect". Based
on what I can
see, you will always get this warning if you use the default argument
values when
instantiating a DB object. This is specifically caused by the
version_cache_deactivate_after value (which defaults to 10). I'm not
sure what the proper fix is for this, but it seems a bit rude to issue
warnings about using deprecated features I did not ask to use ;^).

-Casey



More information about the ZODB-Dev mailing list