michael@d2m.at  |  +43 (664) 948-8084
You are here: Home Blog 2006 10 27 Look ma, no hands!

Look ma, no hands!

by Michael Haubenwallner last modified Jun 18, 2010 11:01 AM

Problem: Sometimes you want to be sure your Zope3 application is working independent of any objects already stored in the ZODB.

Solution: You replace the ZODB on filesystem with a mapping storage entirely in RAM.

In your 'zope.conf' file replace

<zodb>
<filestorage>
path Data.fs
</filestorage>
</zodb>

with

<zodb>
<mappingstorage>
name AnyNameOrId
</mappingstorage>
</zodb>

Startup Zope3 as usual, add and remove some objects. Watch the transaction log: it is empty, nothing to undo. Watch the ZODBControl screen: database size starts at about 10KB, you can even pack it. Warning: all objects created get lost on shutting down the server.

Have fun ;)

Filed under: , ,