Project

General

Profile

« Previous | Next » 

Revision 1066

Added by Jing Tao over 22 years ago

Fixed some db connection problem

View differences:

src/edu/ucsb/nceas/metacat/ReplicationHandler.java
318 318
            String user = (String)docinfoHash.get("user_owner");
319 319
            String docName = (String)docinfoHash.get("docname");
320 320
            String docType = (String)docinfoHash.get("doctype");
321
            int serverCode = MetacatReplication.getServerCode(docServer);
321
            String docHomeServer = (String)docinfoHash.get("home_server");
322
            //int serverCode = MetacatReplication.getServerCode(docServer);
322 323
            //System.out.println("updating doc: " + docid +" action: "+ action);
323 324
            //docid should include rev number too
324 325
            String accnum=docid+util.getOption("accNumSeparator")+
......
334 335
              //register data file into xml_documents table and wite data file
335 336
              //into file system
336 337
              DocumentImpl.writeDataFile(u.openStream(), datafilePath, 
337
                                  docName,docType, accnum, user,serverCode);
338
                                  docName,docType, accnum, user,docHomeServer);
338 339
              
339 340
              MetacatReplication.replLog("wrote doc " + docid + " from " + 
340 341
                                         docServer);
......
776 777
      {  
777 778
        serverCode = rs.getInt(1);
778 779
        pstmt.close();
779
        ut.returnConnection(conn);
780
        conn.close();
780 781
        return serverCode;
781 782
      }
782 783
      //if couldn't find in xml_documents table, we think server code is 1
......
784 785
      else
785 786
      {
786 787
        pstmt.close();
787
        ut.returnConnection(conn);
788
        conn.close();
788 789
        return serverCode;
789 790
      }
790 791
      
......
800 801
      try 
801 802
      {
802 803
        pstmt.close();
803
        ut.returnConnection(conn);
804
        conn.close();
804 805
        return serverCode;
805 806
      } 
806 807
      catch(Exception ee) 

Also available in: Unified diff