Project

General

Profile

« Previous | Next » 

Revision 5186

Added by Jing Tao over 14 years ago

Fix the bug of http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4645. handleGetRevisionAndDocTypeAction will search both xml_documents and xml_revisions table.
It also changed some constrain in AccessionNumber when user update a document, of which all previous versions are in xml_revisions table.

View differences:

AccessionNumber.java
224 224
      pstmt.execute();
225 225
      ResultSet rs = pstmt.getResultSet();
226 226
      hasCurrentAccNumber = rs.next();
227
      if(!hasCurrentAccNumber)
228
      {
229
        //need to look xml_revision table;
230
        pstmt = conn.prepareStatement(
231
            "SELECT 'x' FROM xml_revisions " +
232
            "WHERE docid = ?");
233
        pstmt.setString(1, accNumber);
234
        pstmt.execute();
235
        rs = pstmt.getResultSet();
236
        hasCurrentAccNumber = rs.next();
237
      }
227 238
      pstmt.close();
228 239

  
229 240
    } catch (SQLException e) {
......
295 306

  
296 307
      ResultSet rs = pStmt.getResultSet();
297 308
      boolean hasRow = rs.next();
298
      rev = rs.getInt(1);
309
      if(hasRow)
310
      {
311
        rev = rs.getInt(1);
312
      }     
299 313
      pStmt.close();
300 314

  
301 315
    } catch (SQLException e) {

Also available in: Unified diff