Revision 5311
Added by daigle almost 14 years ago
DocumentImpl.java | ||
---|---|---|
1662 | 1662 |
} |
1663 | 1663 |
// Lastly, update the xml_path_index table |
1664 | 1664 |
if(!pathsFound.isEmpty()){ |
1665 |
try { |
|
1666 |
logMetacat.debug("DocumentImpl.buildIndex - updating path index"); |
|
1665 |
logMetacat.debug("DocumentImpl.buildIndex - updating path index"); |
|
1667 | 1666 |
|
1668 |
updatePathIndex(dbConn, pathsFound); |
|
1669 |
} catch (SQLException sqle) { |
|
1670 |
|
|
1671 |
logMetacat.warn("DocumentImpl.buildIndex - SQL error when updating node " + |
|
1672 |
"index. Sleeping for 3 seconds and trying again : " + sqle.getMessage()); |
|
1673 |
try { |
|
1674 |
Thread.currentThread().sleep(3000); |
|
1675 |
} catch (InterruptedException ie) {} |
|
1676 |
|
|
1677 |
updatePathIndex(dbConn, pathsFound); |
|
1678 |
} |
|
1679 |
pathsFound.clear(); |
|
1667 |
updatePathIndex(dbConn, pathsFound); |
|
1668 |
|
|
1669 |
pathsFound.clear(); |
|
1680 | 1670 |
} |
1681 | 1671 |
} |
1682 | 1672 |
|
... | ... | |
1943 | 1933 |
Iterator<PathIndexEntry> it = pathsFound.values().iterator(); |
1944 | 1934 |
while (it.hasNext()) { |
1945 | 1935 |
PathIndexEntry entry = (PathIndexEntry)it.next(); |
1936 |
if (entry.path.length() > 2784) { |
|
1937 |
logMetacat.warn("DocumentImpl.updatePathIndex - the path for doc id " + entry.docid + |
|
1938 |
" is too long and will db break indexing. This path was not indexed: " + entry.path); |
|
1939 |
continue; |
|
1940 |
} |
|
1941 |
if (entry.nodeData.length() > 2784) { |
|
1942 |
logMetacat.warn("DocumentImpl.updatePathIndex - the node data for doc id " + entry.docid + |
|
1943 |
" is too long and will break db indexing. This path was not indexed: " + entry.path); |
|
1944 |
continue; |
|
1945 |
} |
|
1946 | 1946 |
pstmt.setString(1,entry.docid); |
1947 | 1947 |
pstmt.setString(2, entry.path); |
1948 | 1948 |
pstmt.setString(3, entry.nodeData); |
... | ... | |
2464 | 2464 |
|
2465 | 2465 |
pstmt.close(); |
2466 | 2466 |
if(action.equals("UPDATE")){ |
2467 |
/*// Delete the old nodes in xml_nodes table... |
|
2468 |
pstmt = connection.prepareStatement("DELETE FROM xml_nodes " |
|
2469 |
+ "WHERE rootnodeid = ?"); |
|
2470 |
// Increase dbconnection usage count |
|
2471 |
connection.increaseUsageCount(1); |
|
2472 |
// Bind the values to the query and execute it |
|
2473 |
pstmt.setLong(1, thisdoc.getRootNodeID()); |
|
2474 |
pstmt.execute(); |
|
2475 |
pstmt.close();*/ |
|
2476 | 2467 |
logMetacat.debug("DocumentImpl.writeDocumentToDB - Deleting xml nodes for docid: " + |
2477 | 2468 |
thisdoc.getDocID() + " using root node ID: " + thisdoc.getRootNodeID()); |
2478 | 2469 |
deleteXMLNodes(connection, thisdoc.getRootNodeID()); |
Also available in: Unified diff
Merge 1.9.2 changes back into the trunk