vgritsenko    2003/12/11 07:35:21

  Modified:    .        status.xml
               java/src/org/apache/xindice/core Collection.java
                        SystemCollection.java
  Log:
  Fix bug 14846: SysSymbols not properly deleted
  
  Revision  Changes    Path
  1.13      +3 -0      xml-xindice/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-xindice/status.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- status.xml        5 Sep 2003 02:28:25 -0000       1.12
  +++ status.xml        11 Dec 2003 15:35:20 -0000      1.13
  @@ -60,6 +60,9 @@
       <changes>
           <!-- Add new releases here -->
           <release version="1.1-dev" date="September 4 2003">
  +            <action dev="VG" type="fix" fixes-bug="14846">
  +                Drop SysSymbols when deleting collection.
  +            </action>
               <action dev="VG" type="add">
                   Updated build scripts: all build properties extracted into 
build.properties
                   file. You can override them in local.build.properties file.
  
  
  
  1.39      +10 -7     
xml-xindice/java/src/org/apache/xindice/core/Collection.java
  
  Index: Collection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Collection.java   21 Aug 2003 18:14:53 -0000      1.38
  +++ Collection.java   11 Dec 2003 15:35:20 -0000      1.39
  @@ -417,6 +417,12 @@
           }
   
           getCollectionRoot().delete();
  +
  +        // Drop symbols
  +        if (!internalSymbols) {
  +            getSystemCollection().dropSymbols(this);
  +        }
  +
           getDatabase().flushConfig();
           return true;
       }
  @@ -1074,15 +1080,12 @@
           if (null == filer) {
               return EMPTY_STRING_ARRAY;
           } else {
  -            RecordSet set = filer.getRecordSet();
  -
  -            // todo: what happens if the size if > than the size of an int.
  -            // I'm pretty sure some sort of runtime exception will occur
  -            // in the ArrayList.add method.
  +            // TODO: ArrayList length is limited to the int, while filer 
record count is long
   
               // give a hint to the size of the record set, saves on arraylist 
array copies.
               ArrayList temp = new ArrayList((int) filer.getRecordCount());
   
  +            RecordSet set = filer.getRecordSet();
               while (set.hasMoreRecords()) {
                   Key key = set.getNextKey();
                   temp.add(key.toString());
  
  
  
  1.20      +22 -2     
xml-xindice/java/src/org/apache/xindice/core/SystemCollection.java
  
  Index: SystemCollection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/SystemCollection.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SystemCollection.java     8 Aug 2003 22:47:14 -0000       1.19
  +++ SystemCollection.java     11 Dec 2003 15:35:21 -0000      1.20
  @@ -170,6 +170,26 @@
           }
       }
   
  +    /**
  +     * dropSymbols drop the SymbolTable for the specified Collection.
  +     *
  +     * @param collection The Collection that owns the SymbolTable
  +     */
  +    public void dropSymbols(Collection collection) throws DBException {
  +        String name = getSymbolTableName(collection);
  +
  +        Collection symCol = getCollection(SYMBOLS);
  +        try {
  +            symCol.remove(name);
  +        } catch (DBException e) {
  +            if (e.faultCode == FaultCodes.COL_DOCUMENT_NOT_FOUND) {
  +                // ignore
  +                return;
  +            }
  +            throw e;
  +        }
  +    }
  +
       public static String getDefinition() {
           return SYSCOL_DEFINITION;
       }
  
  
  

Reply via email to