Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5368/src/org/exist/xmlrpc
Modified Files:
RpcConnection.java
Log Message:
Fixed some synchronization issues in the XQuery engine:
* Compiled XQuery expressions are no longer shared between
different threads. The XQuery cache in XQueryServlet and
XQueryGenerator is declared as thread local now.
* The XQueryContext of a compiled XQuery now gets the correct
database broker object set.
Index: RpcConnection.java
===================================================================
RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** RpcConnection.java 25 Feb 2004 15:31:58 -0000 1.46
--- RpcConnection.java 5 Mar 2004 11:15:28 -0000 1.47
***************
*** 37,43 ****
import org.exist.dom.SortedNodeSet;
import org.exist.memtree.NodeImpl;
- import org.exist.xquery.parser.XQueryLexer;
- import org.exist.xquery.parser.XQueryParser;
- import org.exist.xquery.parser.XQueryTreeParser;
import org.exist.security.Permission;
import org.exist.security.PermissionDeniedException;
--- 37,40 ----
***************
*** 56,59 ****
--- 53,59 ----
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+ import org.exist.xquery.parser.XQueryLexer;
+ import org.exist.xquery.parser.XQueryParser;
+ import org.exist.xquery.parser.XQueryTreeParser;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
***************
*** 152,159 ****
if(namespaces != null && namespaces.size() > 0) {
context.declareNamespaces(namespaces);
- // for(Iterator i = namespaces.entrySet().iterator(); i.hasNext(); ) {
- // Map.Entry entry = (Map.Entry)i.next();
- // context.declareNamespace((String)entry.getKey(), (String)entry.getValue());
- // }
}
LOG.debug("compiling " + xquery);
--- 152,155 ----
***************
*** 203,207 ****
context.setBaseURI(baseURI);
context.setStaticallyKnownDocuments(docs);
!
long start = System.currentTimeMillis();
Sequence result = expr.eval(contextSet, null);
--- 199,208 ----
context.setBaseURI(baseURI);
context.setStaticallyKnownDocuments(docs);
! Hashtable namespaces = (Hashtable)parameters.get(RpcAPI.NAMESPACES);
! if(namespaces != null && namespaces.size() > 0) {
! context.declareNamespaces(namespaces);
! }
! // set the current broker object when reusing a compiled query:
! context.setBroker(broker);
long start = System.currentTimeMillis();
Sequence result = expr.eval(contextSet, null);
|