From: Wolfgang M. M. <wol...@us...> - 2004-07-28 18:55:42
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4115/src/org/exist/storage/store Modified Files: DOMFile.java NodeIterator.java Log Message: * Fixed locking error: a collection object could be unloaded from the cache by one thread, while another thread had still been writing a document being a member of the collection. A moment later, a third thread reloaded the collection and started to write to the same document. However, as the collection had been recreated, there were two instances of the same document in memory. The third thread did thus not respect the lock held by the first thread and started to write without waiting. As a consequence, various page errors were thrown. * When updating a document, the old document metadata had not been correctly removed. Usually, this had no consequences as the collection class only used the last record it found. In some cases however, this may have led to errors. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFile.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** DOMFile.java 28 Jul 2004 17:40:05 -0000 1.42 --- DOMFile.java 28 Jul 2004 18:54:56 -0000 1.43 *************** *** 1192,1200 **** public void removeAll(long p) { ! StringBuffer debug = new StringBuffer(); ! debug.append("Removed pages: "); long pnum = StorageAddress.pageFromPointer(p); while(-1 < pnum) { ! debug.append(' ').append(pnum); DOMPage page = getCurrentPage(pnum); pnum = page.getPageHeader().getNextDataPage(); --- 1192,1200 ---- public void removeAll(long p) { ! // StringBuffer debug = new StringBuffer(); ! // debug.append("Removed pages: "); long pnum = StorageAddress.pageFromPointer(p); while(-1 < pnum) { ! // debug.append(' ').append(pnum); DOMPage page = getCurrentPage(pnum); pnum = page.getPageHeader().getNextDataPage(); *************** *** 1213,1217 **** } } ! LOG.debug(debug.toString()); } --- 1213,1217 ---- } } ! // LOG.debug(debug.toString()); } *************** *** 1408,1412 **** getNodeValue(os, rec, false); if (children - attributes > 1) ! os.write((byte) 0x20); } return; --- 1408,1412 ---- getNodeValue(os, rec, false); if (children - attributes > 1) ! os.write((byte) ' '); } return; Index: NodeIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/NodeIterator.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NodeIterator.java 12 Jul 2004 17:17:41 -0000 1.13 --- NodeIterator.java 28 Jul 2004 18:54:56 -0000 1.14 *************** *** 213,216 **** --- 213,218 ---- } else if (-1 < startAddress) { final DOMFile.RecordPos rec = db.findRecord(startAddress); + if(rec == null) + throw new IOException("Node not found at specified address."); page = rec.page.getPageNum(); offset = rec.offset - 2; |