zodb

Method for indexing an object database

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 04:01:14
问题 I'm using an object database (ZODB) in order to store complex relationships between many objects but am running into performance issues. As a result I started to construct indexes in order to speed up object retrieval and insertion. Here is my story and I hope that you can help. Initially when I would add an object to the database I would insert it in a branch dedicated to that object type. In order to prevent multiple objects representing the same entity I added a method that would iterate

ZODB not able to commit

99封情书 提交于 2019-12-04 16:21:37
I am using ZODB first time. Just trying to commit the data with FileStorage. But when I do the same script second time I am not able to commit the new object. Here is my script from ZODB import FileStorage,DB import transaction storage = FileStorage.FileStorage('/tmp/test.fs') db = DB(storage) conn = db.open() root = conn.root() #root['layer']={} root['layer']['2b']={"id":'2b','name':'some name'} transaction.commit() conn.close() db.close() storage.close() when I repeat the code once again, with just changing the id root['layer']['2c'] and come out of the python, the second time object is not

How to do proper memory management with ZODB?

南笙酒味 提交于 2019-12-01 19:40:33
I read several ZODB tutorials but here is one thing I still don't get: How do you free memory that is already serialized (and committed) to the (say) FileStorage? More specifically, I want the following code to stop eating all my memory: for i in xrange(bignumber): iobtree[i]=Bigobject() # Bigobject is about 1Mb if(i%10==0): transaction.commit() # or savepoint(True) transaction.commit() How can this be achieved? Is it possible to release references stored by iobtree and replace them by 'weak references' that would be accessible on demand? Creating savepoints and commiting the transaction

How to do proper memory management with ZODB?

可紊 提交于 2019-12-01 19:11:40
问题 I read several ZODB tutorials but here is one thing I still don't get: How do you free memory that is already serialized (and committed) to the (say) FileStorage? More specifically, I want the following code to stop eating all my memory: for i in xrange(bignumber): iobtree[i]=Bigobject() # Bigobject is about 1Mb if(i%10==0): transaction.commit() # or savepoint(True) transaction.commit() How can this be achieved? Is it possible to release references stored by iobtree and replace them by 'weak

zc.lockfile.LockError in ZODB

我的未来我决定 提交于 2019-12-01 19:08:54
I am trying to use ZODB 3.10.2 on my web server which is running Debian and Python 2.7.1. It seems like every time I try to access the same database from 2 different processes, I get a mysterious exception. I tried accessing a database from an interactive Python session and everything seemed to work fine: >>> import ZODB >>> from ZODB.FileStorage import FileStorage >>> storage = FileStorage("test.db") >>> But then I tried the same series of commands from another session running at the same time and it didn't seem to work: >>> import ZODB >>> from ZODB.FileStorage import FileStorage >>> storage

What is the difference between the various ZODB blobstorage layouts?

非 Y 不嫁゛ 提交于 2019-11-29 11:01:50
The ZODB blobstorage directory contains a .layout file with the string 'lawn', 'bushy'. What is the difference between the various blob storage directory formats? It is explained here: http://svn.zope.org/ZODB/trunk/src/ZODB/tests/blob_layout.txt?rev=101802&view=markup FTA: ====================== Blob directory layouts The internal structure of the blob directories is governed by so called layouts . The current default layout is called bushy . The original blob implementation used a layout that we now call lawn and which is still available for backwards compatibility. Layouts implement two

What is the difference between the various ZODB blobstorage layouts?

我是研究僧i 提交于 2019-11-28 04:11:41
问题 The ZODB blobstorage directory contains a .layout file with the string 'lawn', 'bushy'. What is the difference between the various blob storage directory formats? 回答1: It is explained here: http://svn.zope.org/ZODB/trunk/src/ZODB/tests/blob_layout.txt?rev=101802&view=markup FTA: ====================== Blob directory layouts The internal structure of the blob directories is governed by so called layouts . The current default layout is called bushy . The original blob implementation used a

when to commit data in ZODB

放肆的年华 提交于 2019-11-27 02:48:05
问题 I am trying to handel the data generated by the following piece of code: for Gnodes in G.nodes() # Gnodes iterates over 10000 values Gvalue = someoperation(Gnodes) for Hnodes in H.nodes() # Hnodes iterates over 10000 values Hvalue =someoperation(Hnodes) score = SomeOperation on (Gvalue,Hvalue) dic_score.setdefault(Gnodes,[]).append([Hnodes, score, -1 ]) Since the dictionary is large (10000 keys X 10000 list with 3 elements each), it is difficult to keep it in memory. I was looking for a