Thanks for the detailed reply! That really clears things up.
> > - Are there any other caching options?
> The option to make pickle cache persistent comes to mind. There may be
> I don't recall right now.
This seems like a good idea - I would like for the server to maintain its
cache when I restart it (which is fairly often as I'm always working on
it). However, I seem to have run into some problems. I tried this uri
(added newlines for ease of reading):
Yet I get a "zc.lockfile.LockError: Couldn't lock 'zeocache/main-1.zec.lock'"
error. I've tried googling it and it seems like this happens if multiple
processes attempt to access the same database if one isn't using ZEO, but I
am using ZEO and this is only related to the cache. I'm using paster to
serve the app and I don't think it creates multiple processes. Why might
this be happening? Here is my `app` function that paster uses to get the
wsgi app along with all relevant code:
from repoze.bfg.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from util.pyshell import in_shell
from mainapp.models import appmaker
from mainapp import server_threads
if not in_shell():
def app(global_config, **settings):
zodb_uri = global_config.get('zodb_uri')
if zodb_uri is None:
raise ValueError("No 'zodb_uri' in application configuration.")
zcml_file = settings.get('configure_zcml', 'configure.zcml')
finder = PersistentApplicationFinder(zodb_uri, appmaker)
config = Configurator(root_factory=get_root, settings=settings)
th = threading.Thread(target=check_start_threads)
Seems fairly straightforward, no?
For more information about ZODB, see http://zodb.org/
ZODB-Dev mailing list - ZODB-Dev@zope.org