Paul Winkler wrote at 2004-5-19 19:15 -0400:
>I'm trying to figure out how to mount my main storage read-only
>with zope 2.7.0.

I fear this is not implemented...

Because, I wanted to control this behaviour through an
environment variable (and not the configuration file!),
I patched "Zope/App/":

def _isReadOnly():
    ro= os.environ.get('ZODB_READ_ONLY')
    return ro and int(ro) or 0

def startup():
        # Try to use custom storage
        # if there is no custom_zodb, use the config file specified databases
        configuration = getConfiguration()
        if _isReadOnly():
configuration.dbtab.getDatabaseFactory('/') = True

As you can see, it is the storage (and not the database),
that must get the "read-only" declaration.


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to