I never close my collections and that is a bad thing because it causes resource issues with CORBA. Changes via XUpdate are done immediately. Currently, Xindice hasn't the concept of "commit". So, I don't think that is a problem. And the mechanism you are using is what the list suggests. I haven't seen any problems doing this.
HTH, Mark Florian Georg wrote: > Hi, > > We've got an legacy project, that does the following : > 1) open a appropriate collection > 2) do the query & construct output > 3) close the collection > 4) while notFinished goto 1) > > There are only 5-10 Collections, but many documents in them. > The problem is : Doing the query this way, we need 4-6 seconds (!) to > receive a > list of 50 entries ! > > So I constructed a CollectionProxy, which caches the open Collections (in > a Hashtable "Name=>Collection"). > This reduces open/close calls from 62 to 4 !! > Performance is fine now, but : > > 1.) Someone said that I need to close() a Collection after an XUpdate, or > the Update won't be committed. > But I can't close it,or the Proxy needs to re-open it, which results in > the performance issues described above. > 2.) Is it save to use those cached Collection references with concurrent > accesses ? > I mean, since a "col = Proxy.getCollection(...)" returns the same > reference for all who request that collection... > What if s.o. does a "col.close()" ? > > Or should I realize this without a Proxy & shared references to > Collections ? > > thanks in advance > Florian
