Project

General

Profile

« Previous | Next » 

Revision 3350

Added by Jing Tao over 17 years ago

Add a try-catch to handle if a query result is too long.

View differences:

src/edu/ucsb/nceas/metacat/DBQuery.java
797 797
     {
798 798
         key = (String) keys.next();
799 799
         element = (String)partOfDoclist.get(key);
800

  
800
         
801 801
	 // check if the enterRecords is true, elements is not null, element's
802 802
         // length is less than the limit of table column and if the document
803 803
         // has been indexed already
......
812 812
             pstmt.setInt(1, returnfield_id);
813 813
             pstmt.setString(2, key);
814 814
             pstmt.setString(3, element);
815

  
815
            
816 816
             dbconn.increaseUsageCount(1);
817
             pstmt.execute();
818
             pstmt.close();
817
             try
818
             {
819
            	 pstmt.execute();
820
             }
821
             catch(Exception e)
822
             {
823
            	 logMetacat.warn("couldn't insert the element to xml_queryresult table "+e.getLocalizedMessage());
824
             }
825
             finally
826
             {
827
                pstmt.close();
828
             }
819 829
         }
820 830
        
821 831
         // A string with element

Also available in: Unified diff