[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/docs - custom_zodb.py:1.3

Barry Warsaw barry@wooz.org
Fri, 23 Aug 2002 13:17:01 -0400


Update of /cvs-repository/StandaloneZODB/bsddb3Storage/docs
In directory cvs.zope.org:/tmp/cvs-serv1840/docs

Modified Files:
	custom_zodb.py 
Log Message:
Updated


=== StandaloneZODB/bsddb3Storage/docs/custom_zodb.py 1.2 => 1.3 ===
--- StandaloneZODB/bsddb3Storage/docs/custom_zodb.py:1.2	Sat Apr 28 01:54:37 2001
+++ StandaloneZODB/bsddb3Storage/docs/custom_zodb.py	Fri Aug 23 13:17:00 2002
@@ -1,11 +1,24 @@
-# Uncomment the line corresponding to the storage you want to use
-# This syntax requires Python 2.x
+import os
+# Use this block for Full storage
+
+from bsddb3Storage.BerkeleyBase import BerkeleyConfig
+config = BerkeleyConfig()
+# The config instance has four attributes which can be used to tune Full
+# storage.  See the BerkeleyConfig class docstring for details.  Briefly,
+# numlocks sizes the Berkeley lock table, interval specifies the number of
+# ZODB commits after which a Berkeley transaction checkpoint is written, and
+# kbyte and min are passed directly to Berkeley's txn_checkpoint() function.
 #
-#from bsddb3Storage.Packless import Packless as ConcreteStorage
-#from bsddb3Storage.Minimal  import Minimal  as ConcreteStorage
-from bsddb3Storage.Full     import Full     as ConcreteStorage
+# The default number of locks is 20000, but it's not impossible to exhaust
+# those if you have transactions with lots of objects in them (e.g. big
+# catalog updates).  Cranking this number of does consume system resources.
+config.numlocks = 40000
 
-import os
-env = os.path.join('var', 'bsddb3Storage')
+from bsddb3Storage.Full import Full
+envpath = os.path.join('var', 'full')
+Storage = Full(envpath, config=config)
 
-Storage = ConcreteStorage(name='BerkeleyStorage', env=env)
+# Use this block for Autopack
+##from bsddb3Storage.Autopack import Autopack
+##envpath = os.path.join('var', 'autopack')
+##Storage = Autopack(envpath)