[ZODB-Dev] tcp_begin in tests

Tim Peters tim at zope.com
Wed Jul 6 14:19:35 EDT 2005


[Antonio Beamud Montero]
> In my app, I'm using ZODB to store data, the problem is that I
> have implemented several unittest, for every unit test I create the ZODB
> database and when the test finished I destroy the database (including
> files). When I run 2 test, the first is executed ok, but the second test
> give me the next Exception:
>
> Traceback (most recent call last):
>   File "./test_collector.py", line 240, in runTest
>     self.collect = Collector(conf)
>   File "/usr/lib/python2.3/site-packages/mylib/collector.py", line 78,
> in __init__
>     get_transaction().commit()
>   File "/opt/zope/lib/python/ZODB/Transaction.py", line 232, in commit
>     self._commit_begin(jars, subjars, subtransaction)
>   File "/opt/zope/lib/python/ZODB/Transaction.py", line 340, in
> _commit_begin
>      jar.tpc_begin(self)
>   File "/opt/zope/lib/python/ZODB/Connection.py", line 692, in tpc_begin
>     self._storage.tpc_begin(transaction)
> AttributeError: 'NoneType' object has no attribute 'tpc_begin'
>
> To shutdown the class containing the ZODB connection:
>
>   def shutdown(self):
>         self.db.close()
>         self.storage.close()
>         return

This is the only code of yours you've shown us, and, sorry, but it's not
much to go on.  We haven't even seen how you open a database.

> But, if I execute only the second test, all works ok... I've try to debug
> the problem, but the ZODB code is very deep and complex...
>
> Can anybody help me?

Probably not, without more info.  ZODB comes with a large test suite of its
own -- maybe you could study how it opens and closes databases in its own
tests.  Short of that, try to create a minimal, self-contained, failing
test, and post the entire code for that; for what should be obvious reasons,
it's hard debug code we can't see.

> ZODB3-3.2

That's very old now.  ZODB 3.2.8 is the current stable release in the 3.2
line.

> python-2.3.3
> Linux Suse 9.1



More information about the ZODB-Dev mailing list