[Zope-dev] sessionDataManager should create it's temp/xxxx

Chris McDonough chrism@zope.com
Wed, 09 Jan 2002 16:59:13 -0500


Darrell Gallion wrote:

> Is it magic if the Session manager creates it's own
> data container? The first one is created for you but
> not by the Session system. That seems like magic. 


It's created by the Zope package, which indeed is magic, but something 
needed to populate it with default data; it has the minimum amount of 
magic necessary ;-)

> Although the /startup folder is a common idea for
> Windows users. Until the temp folder arrived I didn't
> need such a thing.


Yup.

> Maybe the sessionDataManager could register a
> callback, called during startup. This might be a safer
> time to create any required temp data.

The problem with this is that the SessionDataManager class can do this, 
but individual instances of the class cannot.  There is no efficient way 
to find all the instances of one kind in a ZODB and call a method on 
them at start time unless you were to create some sort of custom 
registry someplace to do keep track of them.

It seems cleaner to be procedural ala some sort of etc/rc.d/init.d at 
startup time which contains scripts that have the power to do arbitrary 
things to instances in the databse.  Then the logic that does the 
necessary minimal magic in the Zope package now could be moved out and 
into this.

This would be a great idea for a Product.

- C