I am trying to use QueryProcessor to compile and cache for later, in case no used modules have changed, is this ok?
Can I concurrently use QueryProcessor within the same JVM in different threads?
Thanks.
Hi Maurice,
Am 06.06.2012 um 14:30 schrieb Mauricio S. Castro:
I am trying to use QueryProcessor to compile and cache for later, in case no used modules have changed, is this ok?
I suppose this will not work, unfortunatedly: the query processor contains some (dynamically evaluated like databases to access) yet stateful information that makes it impossible to cache.
Can I concurrently use QueryProcessor within the same JVM in different threads?
For those very reasons I'd suggest you to use ThreadLocals [1] and a dedicated processor per Thread; that way you are definitely on the safe side.
Creating an instance of QueryProcessor should be a rather lightweight operation, as such I hope this suits your needs.
I hope this helped, feel free to ask for more!
Kind regards Michael
[1] http://docs.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html
basex-talk@mailman.uni-konstanz.de