Use a BTrees.Length.Length object. See Products.ZCatalog.Catalog for an example of its usage.
Guess that would work for the counter problem since the counter property holds an integer value. But what if I wanted to implement a complete access logger which requires string properties for IP addresses or usernames, etc? I took a look at the source code of the Length object and the _p_independent method looks interesting. If I take the Length source code and make it work for other types than integer, say strings, lists, dictionaries, would that work too? Thanks in advance. Wankyu Choi --------------------------------------------------------------- Wankyu Choi CEO/President NeoQuest Communications, Inc. http://www.zoper.net http://www.neoboard.net --------------------------------------------------------------- On Thu, 2003-06-12 at 10:46, Wankyu Choi wrote:
Hi all,
I know the topic has been discussed a lot but I found little help so far.
I want to implement a simple counter or a complete access logger for ZOPE objects.
Here are my (and many others') problems regarding this:
- ZODB bloats. Whenever the value of a counter property gets updated, the host object is copied doubling its size.
- Too many read/write conflicts. No matter how little traffic you expect, you get tons of read/write conflict errors.
I thought about saving counter values/logs in an external storage like a MySQL table or an external file in order to dupe ZODB into thinking no change has been made to the object in question. But that doesn't seem so elegant and generic.
Please share your ideas resolving this issue.
I have yet to study the internals of ZODB, but can't it have a way to update only the designated properties of a persistent object? If not possible, why? ( to avoid bloating ZODB )
Committing a whole object when its access log gets updated lead to excessive conflict errors. By updating only the counter property, for example, the odds of having conflicts would decrease to a substantial degree.
Best regards, Wankyu Choi --------------------------------------------------------------- Wankyu Choi CEO/President NeoQuest Communications, Inc. http://www.zoper.net http://www.neoboard.net ---------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )