[Zope-dev] API for creating sub-ZODBs

Jim Fulton jim@digicool.com
Wed, 20 Oct 1999 00:21:00 +0000


Anthony Pfrunder wrote:
> 
> On Tue, 19 Oct 1999, Andrew M. Kuchling wrote:
> 
> [snip]
> > conn = Zope.App.openExtraZODB( FileStorage, ('/tmp/mystorage.fs',) )
> > root = conn.root()
> > ... whatever ...
> >
> >       Thoughts?  I'm happy to write such a function, if someone will
> > tell me where it should go.
> 
> This is cool!  What would be even better is an example of a Folderish
> mixin which instead of storing its sub-objects within the main db it
> stores it within an external ZODB.  This would be effectively "mounting" a
> filesystem within another but still keeping them separate.  Anyone know
> how to do this?

This is something we plan to support at some point, possibly soon.
It's somewhat complicated because you have to manage the connections to
the various databases.  The connection management is rather tricky
because of the object references accross connections. An object in one
connection cache may reference an object in another connection.

> Taking this one-step-further we could enhance Products such that Products
> using this mixin will automatically store the contents of stuff within its
> Control Panel folder (like ZClasses) in a ZODB within its real world
> directory.  This means we can just zip it up to get both external Python
> code AND the ZClasses that it uses.  If I knew how the ZODB system works
> I'd help out ;).

Through the web products already zip up database objects, including ZClasses,
and code for you when you create an object distribution.  Currently, the data
gets imported into the destination Zope.  We are considering having products
contain read-only databases that get used directly, rather than getting imported.
This would allow some interesting optimizations and would almost certainly be
easier to integrate.

Stay tuned.

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.