From: Wolfgang M. M. <wol...@us...> - 2004-08-03 15:26:13
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8244/src/org/exist/xmlrpc Modified Files: RpcConnection.java Log Message: Revised collection locking to fix various concurrency errors. It is now the responsibility of the caller to lock/unlock a collection. A collection can be retrieved and locked via the new openCollection() method provided by DBBroker. After reading/modifying the collection, it should be unlocked by calling Collection.release. The local XML:DB implementation and the XMLRPC interface have been changed to reflect the new collection locking rules. Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** RpcConnection.java 2 Jul 2004 18:00:35 -0000 1.63 --- RpcConnection.java 3 Aug 2004 15:26:00 -0000 1.64 *************** *** 28,31 **** --- 28,32 ---- import java.io.IOException; import java.io.InputStream; + import java.io.RandomAccessFile; import java.io.StringReader; import java.io.StringWriter; *************** *** 49,52 **** --- 50,54 ---- import org.apache.log4j.Logger; [...1059 lines suppressed...] ! Collection destination = broker.getCollection(destinationPath); if(destination == null) throw new EXistException("Destination collection " + destinationPath + " not found"); --- 2054,2058 ---- // get destination collection ! destination = broker.openCollection(destinationPath, Lock.WRITE_LOCK); if(destination == null) throw new EXistException("Destination collection " + destinationPath + " not found"); *************** *** 1983,1986 **** --- 2063,2070 ---- throw new PermissionDeniedException(e.getMessage()); } finally { + if(collection != null) + collection.release(); + if(destination != null) + destination.release(); brokerPool.release(broker); } |