From: Wolfgang M. M. <wol...@us...> - 2004-07-28 18:55:15
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4115/src/org/exist/dom Modified Files: DocumentImpl.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: DocumentImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/DocumentImpl.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** DocumentImpl.java 19 Jul 2004 13:06:25 -0000 1.50 --- DocumentImpl.java 28 Jul 2004 18:54:57 -0000 1.51 *************** *** 259,267 **** + treeLevelStartPoints[i]; if(treeLevelStartPoints[i + 1] > 0x6fffffffffffffffL || ! treeLevelStartPoints[i + 1] < 0) ! throw new EXistException("the document is too complex/irregularily structured " + "to be mapped into eXist's numbering scheme"); } } public final int compareTo(Object other) { final long otherId = ((DocumentImpl)other).docId; --- 259,281 ---- + treeLevelStartPoints[i]; if(treeLevelStartPoints[i + 1] > 0x6fffffffffffffffL || ! treeLevelStartPoints[i + 1] < 0) { ! throw new EXistException("The document is too complex/irregularily structured " + "to be mapped into eXist's numbering scheme. Number of children per level of the " + ! "tree: " + printTreeLevelOrder()); ! } } } + public String printTreeLevelOrder() { + StringBuffer buf = new StringBuffer(); + buf.append("[ "); + for(int i = 0; i < maxDepth; i++) { + if(i > 0) + buf.append(", "); + buf.append(treeLevelOrder[i]); + } + buf.append(" ]"); + return buf.toString(); + } + public final int compareTo(Object other) { final long otherId = ((DocumentImpl)other).docId; *************** *** 721,725 **** pageCount = istream.readInt(); } catch (IOException e) { ! LOG.warn("io error while reading document data for document " + fileName, e); } } --- 735,740 ---- pageCount = istream.readInt(); } catch (IOException e) { ! LOG.warn("IO error while reading document data for document " + fileName, e); ! LOG.warn("Document address is " + StorageAddress.toString(getAddress())); } } |