From: Wolfgang M. M. <wol...@us...> - 2004-08-03 16:45:59
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/src/org/exist/xmlrpc Modified Files: RpcConnection.java Log Message: All the addDocument methods in org.exist.collections.Collection have been split into two method calls: validate + store. Background: while locking the collection is necessary during validation, this is not really required while the document is being stored. The caller can thus release the lock after validate has completed. Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** RpcConnection.java 3 Aug 2004 15:26:00 -0000 1.64 --- RpcConnection.java 3 Aug 2004 16:45:46 -0000 1.65 *************** *** 52,55 **** --- 52,56 ---- import org.exist.Indexer; import org.exist.collections.Collection; + import org.exist.collections.IndexInfo; import org.exist.collections.triggers.TriggerException; import org.exist.dom.ArraySet; *************** *** 981,985 **** String docName = path.substring(p + 1); InputSource source; ! Indexer indexer; try { collection = broker.openCollection(collectionName, Lock.WRITE_LOCK); --- 982,986 ---- String docName = path.substring(p + 1); InputSource source; ! IndexInfo info; try { collection = broker.openCollection(collectionName, Lock.WRITE_LOCK); *************** *** 995,1004 **** InputStream is = new ByteArrayInputStream(xml); source = new InputSource(is); ! indexer = collection.validate(broker, docName, source); } finally { if(collection != null) collection.release(); } ! collection.store(broker, indexer, source, false); LOG.debug("parsing " + path + " took " + (System.currentTimeMillis() - startTime) + "ms."); --- 996,1005 ---- InputStream is = new ByteArrayInputStream(xml); source = new InputSource(is); ! info = collection.validate(broker, docName, source); } finally { if(collection != null) collection.release(); } ! collection.store(broker, info, source, false); LOG.debug("parsing " + path + " took " + (System.currentTimeMillis() - startTime) + "ms."); *************** *** 1039,1043 **** docName = docName.substring(p + 1); Collection collection = null; ! Indexer indexer; InputSource source; try { --- 1040,1044 ---- docName = docName.substring(p + 1); Collection collection = null; ! IndexInfo info; InputSource source; try { *************** *** 1059,1068 **** } source = new InputSource(uri); ! indexer = collection.validate(broker, docName, source); } finally { if(collection != null) collection.release(); } ! collection.store(broker, indexer, source, false); } finally { brokerPool.release(broker); --- 1060,1069 ---- } source = new InputSource(uri); ! info = collection.validate(broker, docName, source); } finally { if(collection != null) collection.release(); } ! collection.store(broker, info, source, false); } finally { brokerPool.release(broker); |