Paul Winkler wrote:
On Thu, May 20, 2004 at 09:12:35PM +0200, Dieter Maurer wrote:

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...

I now believe it's implemented just fine, but it's problematic
because at least one product (Formulator) triggers a commit
when the product is loaded.


def startup():


configuration.dbtab.getDatabaseFactory('/') = True

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

Understood. I spent a little time with the debugger and determined that this is already handled by adding the "read-only on" line to the <filestorage> section of zope.conf. I confirmed this:

(Pdb) n


-> configuration = getConfiguration() (Pdb) n


-> DB = configuration.dbtab.getDatabase('/', is_root=1)
(Pdb) myconf = configuration.dbtab.getDatabaseFactory('/') (Pdb) p myconf.read_only

So, apparently the storage DOES get the read-only declaration.
If I continue from this point, zope exits during installation
of Formulator, with the aforementioned ZODB.POSException.ReadOnlyError.

But if I remove everything from my Products/ , zope starts and runs
just fine... I only get ReadOnlyError if I try to modify anything,
as I would expect.

Formulator is the only culprit I'm sure of; I can trigger the
error if my Products/ contains only Formulator.
Everything else (ZSyncer, ZopeVersionControl, CMFDefault & dependencies,
some in-house stuff...) seems to be OK.
Not sure of CMFPlone because it depends on Formulator.

I have not yet found exactly how Formulator triggers a commit,
but it is definitely something called by its initialize() function.

It is probably trying to do the Right Thing (TM) by registering with the help system. The fact that the help system writes to the database is a wart the size of my foot.

Tres Seaver                                [EMAIL PROTECTED]
Zope Corporation      "Zope Dealers"

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

Reply via email to