Hi all,
I always work with only one Container ('Default'), but now I'm trying to create new Containers in order to store a lot of differents objects in diferents Containers. I also have a BTreeDictionary per Container. My problem is that when I close de database I can't reach these BTreeDictionaries (inside other containers). transaction root Answer a PersistentDictionary with all BTreeDictionaries inside the Default Container. db containerNamed: 'Users' Answer my second container, but I don't know how to obtain the BTreeDictionaries inside 'Users' container. I can't reach the "root" of 'Users' container, so I can't access to the PersistentDictionary (the root i think) of my second container. Any ideas how to do this ? (work with more than one container) Best Regads Bruno Brasesco |
Hi Bruno
There is only one root object in the database. Also, every persistent object can reference any other persistent object regardless of the container in which the referenced object is physically located. Therefore the simplest way to keep references to btree dictionaries in other containers is to add them to the root object. Example: OmniBase root at: 'my other dictionary in the Users container' put: myBtreeDictionary. To access this other dictionary you can later use something like: myBtreeDictionary := OmniBase root at: 'my other dictionary in the Users container'. Hope this helps. Best regards, David Gorisek http://www.gorisek.com "Bruno Brasesco" <[hidden email]> wrote in message news:9rmatm$u9u1p$[hidden email]... > Hi all, > > I always work with only one Container ('Default'), but now I'm trying to > create new Containers in order to store a lot of differents objects in > diferents Containers. I also have a BTreeDictionary per Container. > > My problem is that when I close de database I can't reach these > BTreeDictionaries (inside other containers). > > transaction root > Answer a PersistentDictionary with all BTreeDictionaries inside the > Container. > db containerNamed: 'Users' > Answer my second container, but I don't know how to obtain the > BTreeDictionaries inside 'Users' container. > I can't reach the "root" of 'Users' container, so I can't access to the > PersistentDictionary (the root i think) of my second container. > > Any ideas how to do this ? (work with more than one container) > > Best Regads > Bruno Brasesco > > > |
Sorry David , I can not understand at all. Can you give me a more detailled
explanation? TIA Pablo "David Gorisek" <[hidden email]> wrote in message news:[hidden email]... > Hi Bruno > > There is only one root object in the database. Also, every persistent object > can reference any other persistent object regardless of the container in > which the referenced object is physically located. > > Therefore the simplest way to keep references to btree dictionaries in other > containers is to add them to the root object. > > Example: > > OmniBase root > at: 'my other dictionary in the Users container' > put: myBtreeDictionary. > > To access this other dictionary you can later use something like: > > myBtreeDictionary := OmniBase root at: 'my other dictionary in the Users > container'. > > Hope this helps. > > Best regards, > > David Gorisek > http://www.gorisek.com > > > "Bruno Brasesco" <[hidden email]> wrote in message > news:9rmatm$u9u1p$[hidden email]... > > Hi all, > > > > I always work with only one Container ('Default'), but now I'm trying to > > create new Containers in order to store a lot of differents objects in > > diferents Containers. I also have a BTreeDictionary per Container. > > > > My problem is that when I close de database I can't reach these > > BTreeDictionaries (inside other containers). > > > > transaction root > > Answer a PersistentDictionary with all BTreeDictionaries inside the > Default > > Container. > > db containerNamed: 'Users' > > Answer my second container, but I don't know how to obtain the > > BTreeDictionaries inside 'Users' container. > > I can't reach the "root" of 'Users' container, so I can't access to the > > PersistentDictionary (the root i think) of my second container. > > > > Any ideas how to do this ? (work with more than one container) > > > > Best Regads > > Bruno Brasesco > > > > > > > > |
Thanks David,
I have done this: base := OmniBase createOn: 'f:\Repository\OmniBase'. dict := base newBTreeDictionary: 20. base newContainer: 'Users'. transaction := base newTransaction. transaction store: dict in: (base containerNamed: 'Users'). transaction root at: 'Users' put: dict. transaction commit. transaction abort. transaction := base newTransaction. transaction root at: 'Users' "this aswer a BTreeDictionary, and this BTreeDictionary is in Users container " Best Regards Bruno Brasesco |
In reply to this post by pablo digonzelli-3
Pablo,
Containers are not persistent objects. Containers provide just another way to cluster objects more efficently when they are stored in the file system. Consider the case when you had 1 million contracts and would like to go over all of them in a batch job. From the file-system performance point of view it would be perfect it all this objects were stored sequentialy in a single file. For this you can use containers. By storing all contracts in one container (file containing serialized objects - bytes) you can go over all your contract with one sequential file scan. This is faster than having objects located in random positions in the default container. Best regards, David Gorisek http://www.gorisek.com "pablo digonzelli" <[hidden email]> wrote in message news:9rpqst$v9773$[hidden email]... > Sorry David , I can not understand at all. Can you give me a more detailled > explanation? > > TIA > Pablo > "David Gorisek" <[hidden email]> wrote in message > news:[hidden email]... > > Hi Bruno > > > > There is only one root object in the database. Also, every persistent > object > > can reference any other persistent object regardless of the container in > > which the referenced object is physically located. > > > > Therefore the simplest way to keep references to btree dictionaries in > other > > containers is to add them to the root object. > > > > Example: > > > > OmniBase root > > at: 'my other dictionary in the Users container' > > put: myBtreeDictionary. > > > > To access this other dictionary you can later use something like: > > > > myBtreeDictionary := OmniBase root at: 'my other dictionary in the Users > > container'. > > > > Hope this helps. > > > > Best regards, > > > > David Gorisek > > http://www.gorisek.com > > > > > > "Bruno Brasesco" <[hidden email]> wrote in message > > news:9rmatm$u9u1p$[hidden email]... > > > Hi all, > > > > > > I always work with only one Container ('Default'), but now I'm trying > > > create new Containers in order to store a lot of differents objects in > > > diferents Containers. I also have a BTreeDictionary per Container. > > > > > > My problem is that when I close de database I can't reach these > > > BTreeDictionaries (inside other containers). > > > > > > transaction root > > > Answer a PersistentDictionary with all BTreeDictionaries inside the > > Default > > > Container. > > > db containerNamed: 'Users' > > > Answer my second container, but I don't know how to obtain the > > > BTreeDictionaries inside 'Users' container. > > > I can't reach the "root" of 'Users' container, so I can't access to > > > PersistentDictionary (the root i think) of my second container. > > > > > > Any ideas how to do this ? (work with more than one container) > > > > > > Best Regads > > > Bruno Brasesco > > > > > > > > > > > > > > > |
Free forum by Nabble | Edit this page |