From: Wolfgang M. M. <wol...@us...> - 2004-08-03 15:26:49
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8244/src/org/exist/http/webdav/methods Modified Files: Delete.java Move.java Copy.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: Move.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods/Move.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Move.java 8 Jun 2004 08:16:07 -0000 1.3 --- Move.java 3 Aug 2004 15:25:58 -0000 1.4 *************** *** 107,111 **** return; } ! broker.removeCollection(destCollection.getName()); replaced = true; } --- 107,111 ---- return; } ! broker.removeCollection(destCollection); replaced = true; } Index: Copy.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods/Copy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Copy.java 22 Jun 2004 10:10:17 -0000 1.1 --- Copy.java 3 Aug 2004 15:25:58 -0000 1.2 *************** *** 108,114 **** boolean replaced = false; DBBroker broker = null; try { broker = pool.get(user); ! Collection destCollection = broker.getCollection(destination); if(destCollection == null) { response.sendError(HttpServletResponse.SC_CONFLICT, --- 108,115 ---- boolean replaced = false; DBBroker broker = null; + Collection destCollection = null; try { broker = pool.get(user); ! destCollection = broker.getCollection(destination); if(destCollection == null) { response.sendError(HttpServletResponse.SC_CONFLICT, *************** *** 138,141 **** --- 139,144 ---- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); } finally { + if(destCollection != null) + destCollection.release(); pool.release(broker); } Index: Delete.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/webdav/methods/Delete.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Delete.java 8 Jun 2004 08:16:07 -0000 1.3 --- Delete.java 3 Aug 2004 15:25:58 -0000 1.4 *************** *** 65,69 **** broker = pool.get(user); if(resource == null) { ! broker.removeCollection(collection.getName()); } else { if(resource.getResourceType() == DocumentImpl.BINARY_FILE) --- 65,69 ---- broker = pool.get(user); if(resource == null) { ! broker.removeCollection(collection); } else { if(resource.getResourceType() == DocumentImpl.BINARY_FILE) |