Project

General

Profile

« Previous | Next » 

Revision 2076

Added by Matt Jones about 20 years ago

Excluded the update of the xml_index table in insert,update, and delete if the usexmlindex option is set to false.

View differences:

EmlSAXHandler.java
28 28

  
29 29
package edu.ucsb.nceas.metacat;
30 30

  
31
import java.sql.*;
32 31
import java.io.BufferedReader;
33
import java.io.IOException;
34 32
import java.io.File;
35 33
import java.io.FileReader;
36 34
import java.io.FileWriter;
35
import java.io.IOException;
37 36
import java.io.Reader;
38
import java.io.StringReader;
37
import java.sql.PreparedStatement;
38
import java.sql.ResultSet;
39
import java.sql.SQLException;
40
import java.sql.Statement;
41
import java.util.EmptyStackException;
42
import java.util.Enumeration;
43
import java.util.Hashtable;
39 44
import java.util.Stack;
40 45
import java.util.Vector;
41
import java.util.Hashtable;
42
import java.util.Enumeration;
43
import java.util.EmptyStackException;
44 46

  
45 47
import org.xml.sax.Attributes;
46 48
import org.xml.sax.SAXException;
47
import org.xml.sax.SAXParseException;
48
import org.xml.sax.ext.DeclHandler;
49
import org.xml.sax.ext.LexicalHandler;
50
import org.xml.sax.helpers.DefaultHandler;
51 49

  
52 50
/**
53 51
 * A database aware Class implementing callback bethods for the SAX parser to
......
1479 1477
   
1480 1478
     // Starting new thread for writing XML Index.
1481 1479
     // It calls the run method of the thread.
1482
     try 
1483
     {
1484
       xmlIndex.start();
1485
     } 
1486
     catch (NullPointerException e) 
1487
     {
1488
       xmlIndex = null;
1489
       throw new
1490
       SAXException("Problem with starting thread for writing XML Index. " +
1491
                    e.getMessage());
1480
     boolean useXMLIndex = 
1481
         (new Boolean(MetaCatUtil.getOption("usexmlindex"))).booleanValue();
1482
     if (useXMLIndex) {
1483
            try {
1484
                xmlIndex.start();
1485
            } catch (NullPointerException e) {
1486
                xmlIndex = null;
1487
                throw new SAXException(
1488
                        "Problem with starting thread for writing XML Index. "
1489
                                + e.getMessage());
1490
            }
1492 1491
     }
1493
   
1494 1492
   }
1495 1493
   
1496
  /* The method to write all access rule intodb */
1494
  /* The method to write all access rule into db */
1497 1495
  private void writeAccessRuleToDB() throws SAXException
1498 1496
  {
1499 1497
    //Delete old permssion

Also available in: Unified diff