Project

General

Profile

« Previous | Next » 

Revision 5160

Added by daigle almost 15 years ago

beef up error log messages

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
2550 2550
    	// Get the xml as a string so we can write to file later
2551 2551
    	String xmlString = StringUtil.readerToString(xml);
2552 2552
    	
2553
        logMetacat.info("conn usage count before writting: "
2553
        logMetacat.info("DocumentImpl.write - conn usage count before writting: "
2554 2554
                + conn.getUsageCount());
2555 2555
        AccessionNumber ac = new AccessionNumber(accnum, action);
2556 2556
        String docid = ac.getDocid();
2557 2557
        String rev = ac.getRev();
2558
        logMetacat.warn("action: " + action + " servercode: "
2558
        logMetacat.info("DocumentImpl.write - action: " + action + " servercode: "
2559 2559
                + serverCode + " override: " + override);
2560 2560

  
2561 2561
        if ((serverCode != 1 && action.equals("UPDATE")) && !override) {
......
2564 2564
            // the resident server will not give a lock then we send the user
2565 2565
            // a  message saying that he/she needs to download a new copy of
2566 2566
            // the file and merge the differences manually.
2567
//            int istreamInt;
2568
//            char istreamChar;
2569 2567

  
2570 2568
            // check for 'write' permission for 'user' to update this document
2571 2569
            if (!hasWritePermission(user, groups, accnum)) {
......
2639 2637
                // Force replication the docid
2640 2638
                ForceReplicationHandler frh = new ForceReplicationHandler(
2641 2639
                        accnum, true, null);
2642
                logMetacat.debug("ForceReplicationHandler created: " + frh.toString());
2640
                logMetacat.debug("DocumentImpl.write - ForceReplicationHandler created: " + frh.toString());
2643 2641
                return (accnum);
2644 2642

  
2645 2643
            }
......
2648 2646
                // the file is currently locked by another user notify our
2649 2647
                // user to wait a few minutes, check out a new copy and try
2650 2648
                // again.
2651
            	logReplication.error("lock denied for " + accnum + " on "
2649
            	logReplication.error("DocumentImpl.write - lock denied for " + accnum + " on "
2652 2650
                        + server + " reason: file already locked");
2653 2651
                throw new Exception(
2654 2652
                        "The file specified is already locked by another "
......
2659 2657
                // our file is outdated. notify our user to check out a new
2660 2658
                // copy of the file and merge his version with the new version.
2661 2659
                //System.out.println("outdated file");
2662
            	logReplication.info("lock denied for " + accnum + " on "
2660
            	logReplication.info("DocumentImpl.write - lock denied for " + accnum + " on "
2663 2661
                        + server + " reason: local file outdated");
2664 2662
                throw new Exception(
2665 2663
                        "The file you are trying to update is an outdated"
......
2686 2684
                    //false means it is not a revision doc
2687 2685

  
2688 2686
            conn.setAutoCommit(false);
2687
            logMetacat.debug("DocumentImpl.write - XML to be parsed: " + xml);
2689 2688
            parser.parse(new InputSource(xml));
2690
            //System.out.println("commit!!!!!!!!!!!!!!!!!111");
2689

  
2691 2690
            conn.commit();
2692 2691
            conn.setAutoCommit(true);
2693 2692
            
......
2696 2695

  
2697 2696
            addDocidToIndexingQueue(docid, rev);
2698 2697
        } catch (Exception e) {
2699
        	logMetacat.error("Problem with parsing: " + e.getMessage());
2698
        	logMetacat.error("DocumentImpl.write - Problem with parsing: " + e.getMessage());
2700 2699
            e.printStackTrace();
2701 2700
            conn.rollback();
2702 2701
            conn.setAutoCommit(true);
......
2729 2728
              pstmt.close();
2730 2729
              conn.increaseUsageCount(1);
2731 2730
          } catch (Exception e){
2732
              logMetacat.error("Error in deleting enteries from "
2731
              logMetacat.error("DocumentImpl.write - Error in deleting enteries from "
2733 2732
                                       + "xml_queryresult where docid is "
2734 2733
                                       + docid + " in DBQuery.write: "
2735 2734
                                       + e.getMessage());
......
2743 2742
        // metacat notify the force replication.
2744 2743
        ForceReplicationHandler frh = new ForceReplicationHandler(accnum,
2745 2744
                action, true, null);
2746
        logMetacat.debug("ForceReplicationHandler created: " + frh.toString());
2745
        logMetacat.debug("DocumentImpl.write - ForceReplicationHandler created: " + frh.toString());
2747 2746
        // clear cache after inserting or updating a document
2748 2747
        if (PropertyService.getProperty("database.queryCacheOn").equals("true"))
2749 2748
        {
......
2751 2750
     	   DBQuery.clearQueryResultCache();
2752 2751
        }
2753 2752

  
2754
        logMetacat.info("Conn Usage count after writting: "
2753
        logMetacat.info("DocumentImpl.write - Conn Usage count after writing: "
2755 2754
                + conn.getUsageCount());
2756 2755
        return (accnum);
2757 2756
    }

Also available in: Unified diff