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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to