Project

General

Profile

« Previous | Next » 

Revision 4140

Added by daigle almost 16 years ago

Add sql debug statements

View differences:

src/edu/ucsb/nceas/metacat/AssociateAccessPolicy.java
234 234
      //bind value
235 235
      pStmt.setString(1, docId);
236 236
      //excute the query
237
      logMetacat.debug("running sql: " + pStmt.toString());
237 238
      pStmt.execute();
238 239
      pStmt.close();
239 240
    }//try
......
467 468
                {
468 469
                  insertStatement.setString(6, null);
469 470
                }
471
                logMetacat.debug("running sql: " + insertStatement.toString());
470 472
                insertStatement.execute();
471 473
                hasRecord=rs.next();
472 474
              }//while
src/edu/ucsb/nceas/metacat/DocumentImpl.java
2834 2834
            pstmt = conn.prepareStatement(
2835 2835
                    "DELETE FROM xml_access WHERE accessfileid = ?");
2836 2836
            pstmt.setString(1, docid);
2837
            logMetacat.debug("running sql: " + pstmt.toString());
2837 2838
            pstmt.execute();
2838 2839
            pstmt.close();
2839 2840
            conn.increaseUsageCount(1);
......
2842 2843
            pstmt = conn.prepareStatement(
2843 2844
                    "DELETE FROM xml_access WHERE docid = ?");
2844 2845
            pstmt.setString(1, docid);
2846
            logMetacat.debug("running sql: " + pstmt.toString());
2845 2847
            pstmt.execute();
2846 2848
            pstmt.close();
2847 2849
            conn.increaseUsageCount(1);
......
2851 2853
            pstmt = conn.prepareStatement(
2852 2854
                    "DELETE FROM xml_queryresult WHERE docid = ?");
2853 2855
            pstmt.setString(1, docid);
2856
            logMetacat.debug("running sql: " + pstmt.toString());
2854 2857
            pstmt.execute();
2855 2858
            pstmt.close();
2856 2859
            conn.increaseUsageCount(1);
......
2861 2864
                    "DELETE FROM xml_relation WHERE docid = ?");
2862 2865
            //increase usage count
2863 2866
            pstmt.setString(1, docid);
2867
            logMetacat.debug("running sql: " + pstmt.toString());
2864 2868
            pstmt.execute();
2865 2869
            pstmt.close();
2866 2870
            conn.increaseUsageCount(1);
......
2873 2877
                    "DELETE FROM xml_path_index WHERE docid = ?");
2874 2878
            //increase usage count
2875 2879
            pstmt.setString(1, docid);
2880
            logMetacat.debug("running sql: " + pstmt.toString());
2876 2881
            pstmt.execute();
2877 2882
            pstmt.close();
2878 2883
            conn.increaseUsageCount(1);
......
2883 2888
                    "DELETE FROM xml_accesssubtree WHERE docid = ?");
2884 2889
            //increase usage count
2885 2890
            pstmt.setString(1, docid);
2891
            logMetacat.debug("running sql: " + pstmt.toString());
2886 2892
            pstmt.execute();
2887 2893
            pstmt.close();
2888 2894
            conn.increaseUsageCount(1);
......
2891 2897
            pstmt = conn.prepareStatement(
2892 2898
                    "DELETE FROM xml_documents WHERE docid = ?");
2893 2899
            pstmt.setString(1, docid);
2900
            logMetacat.debug("running sql: " + pstmt.toString());
2894 2901
            pstmt.execute();
2895 2902
            pstmt.close();
2896 2903
            //Usaga count increase 1
......
2906 2913
                   conn.increaseUsageCount(1);
2907 2914
                   // Bind the values to the query and execute it
2908 2915
                   pstmt.setString(1, docid);
2916
                   logMetacat.debug("running sql: " + pstmt.toString());
2909 2917
                   pstmt.execute();
2910 2918
                   pstmt.close();
2911 2919

  
src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java
2139 2139
                   pstmt.setString(2, prName);
2140 2140
                   logMetacat.info("Principal in accesstable: "
2141 2141
                           + prName);
2142
                   logMetacat.debug("running sql: " + pstmt.toString());
2142 2143
                   pstmt.execute();
2143 2144
               }//for
2144 2145
           }//for
......
2321 2322
            logMetacat.info("Start node id is: " + startNodeId);
2322 2323
            pstmt.setLong(6, endNodeId);
2323 2324
            logMetacat.info("End node id is: " + endNodeId);
2325
            logMetacat.debug("running sql: " + pstmt.toString());
2324 2326
            pstmt.execute();
2325 2327
            pstmt.close();
2326 2328
        }//try
......
2353 2355
            // delete all acl records for resources related to @aclid if any
2354 2356
            stmt = connection.createStatement();
2355 2357
            // Increase DBConnection usage count
2356
            connection.increaseUsageCount(1);
2358
            connection.increaseUsageCount(1);                   
2359
            logMetacat.debug("running sql: DELETE FROM xml_accesssubtree WHERE docid = '"
2360
                    + docId + "'");
2357 2361
            stmt.execute("DELETE FROM xml_accesssubtree WHERE docid = '"
2358 2362
                    + docId + "'");
2359 2363

  
src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java
1765 1765
                    pstmt.setString(2, prName);
1766 1766
                    logMetacat.info("Principal in accesstable: "
1767 1767
                            + prName);
1768
                    logMetacat.debug("running sql: " + pstmt.toString());
1768 1769
                    pstmt.execute();
1769 1770
                }//for
1770 1771
            }//for
......
1833 1834
                    pstmt.setString(2, prName);
1834 1835
                    logMetacat.info("Principal in accesstable: "
1835 1836
                            + prName);
1837
                    logMetacat.debug("running sql: " + pstmt.toString());
1836 1838
                    pstmt.execute();
1837 1839
                }//for
1838 1840
            }//for
......
1863 1865
            stmt = connection.createStatement();
1864 1866
            // Increase DBConnection usage count
1865 1867
            connection.increaseUsageCount(1);
1868
            logMetacat.debug("running sql: DELETE FROM xml_access WHERE accessfileid = '"
1869
                    + aclid + "'");
1866 1870
            stmt.execute("DELETE FROM xml_access WHERE accessfileid = '"
1867 1871
                    + aclid + "'");
1868 1872

  
......
1916 1920
            logMetacat.info("Start node id is: " + startNodeId);
1917 1921
            pstmt.setLong(6, endNodeId);
1918 1922
            logMetacat.info("End node id is: " + endNodeId);
1923
            logMetacat.debug("running sql: " + pstmt.toString());
1919 1924
            pstmt.execute();
1920 1925
            pstmt.close();
1921 1926
        }//try
......
1944 1949
            stmt = connection.createStatement();
1945 1950
            // Increase DBConnection usage count
1946 1951
            connection.increaseUsageCount(1);
1952
            logMetacat.debug("running sql: DELETE FROM xml_accesssubtree WHERE docid = '"
1953
                    + docId + "'");
1947 1954
            stmt.execute("DELETE FROM xml_accesssubtree WHERE docid = '"
1948 1955
                    + docId + "'");
1949 1956

  
src/edu/ucsb/nceas/metacat/AccessControlList.java
35 35
import java.net.URL;
36 36
import java.net.MalformedURLException;
37 37

  
38
import org.apache.log4j.Logger;
38 39
import org.xml.sax.Attributes;
39 40
import org.xml.sax.InputSource;
40 41
import org.xml.sax.ContentHandler;
......
95 96
  private Vector aclObjects = new Vector();
96 97
  private boolean instarttag = true;
97 98
  private String tagName = "";
99
  
100
  private static Logger logMetacat = Logger.getLogger(AccessControlList.class);
98 101
  /**
99 102
   * Construct an instance of the AccessControlList class.
100 103
   * It is used by the permission check up from DBQuery or DocumentImpl
......
478 481
      stmt = connection.createStatement();
479 482
      // Increase DBConnection usage count
480 483
      connection.increaseUsageCount(1);
484
      logMetacat.debug("running sql: " + stmt.toString());
481 485
      stmt.execute("DELETE FROM xml_access WHERE accessfileid = '" + aclid 
482 486
                                                                      + "'");
483 487
      //increase usageCount!!!!!!
......
536 540
      for ( int j = 0; j < principal.size(); j++ ) {
537 541
        prName = (String)principal.elementAt(j);
538 542
        pstmt.setString(2, prName);
543
        logMetacat.debug("running sql: " + pstmt.toString());
539 544
        pstmt.execute();
540 545
      /*    
541 546
        // check if there are conflict with permission's order
......
588 593
      pstmt.setString(1, docid);
589 594
      pstmt.setString(2, principal);
590 595
      pstmt.setString(3, permOrder);
596
      logMetacat.debug("running sql: " + pstmt.toString());
591 597
      pstmt.execute();
592 598
      ResultSet rs = pstmt.getResultSet();
593 599
      boolean hasRow = rs.next();
......
717 723
              "ORDER BY accessfileid, perm_order, perm_type, permission");
718 724
      // Bind the values to the query
719 725
      pstmt.setString(1, docid);
726
      logMetacat.debug("running sql: " + pstmt.toString());
720 727
      pstmt.execute();
721 728
      ResultSet rs = pstmt.getResultSet();
722 729
      boolean hasRows = rs.next();

Also available in: Unified diff