Project

General

Profile

« Previous | Next » 

Revision 5198

Added by daigle almost 15 years ago

do a quick retry if building path index fails with a SQL error

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
1634 1634
                                    currentNode.getNodeId(),
1635 1635
                                    currentNode.getNodeId(), 
1636 1636
                                    "", pathList, pathsFound);
1637

  
1637 1638
                    updateNodeIndex(dbConn, pathList);
1638 1639
                } else if ( currentNode.getNodeType().equals("TEXT") ) {
1639 1640
                  
......
1660 1661
                }
1661 1662
                // Lastly, update the xml_path_index table
1662 1663
                if(!pathsFound.isEmpty()){
1663
              		updatePathIndex(dbConn, pathsFound);
1664
                    try {
1665
                    	updatePathIndex(dbConn, pathsFound);
1666
                    } catch (SQLException sqle) {
1667
                    	
1668
                    	logMetacat.warn("DocumentImpl.buildIndex - SQL error when updating node " + 
1669
                    			"index.  Sleeping for 3 seconds and trying again : " + sqle.getMessage());
1670
                    	try {
1671
                    		Thread.currentThread().sleep(3000);
1672
                    	} catch (InterruptedException ie) {}
1673
                    	
1674
                    	updatePathIndex(dbConn, pathsFound);
1675
                    }
1664 1676
                  pathsFound.clear();
1665 1677
                }
1666 1678
            }

Also available in: Unified diff