Bug 33441 - creating multiple collections(hierarchy) fails
Summary: creating multiple collections(hierarchy) fails
Status: CLOSED DUPLICATE of bug 28783
Alias: None
Product: Xindice
Classification: Unclassified
Component: DB Engine (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 blocker
Target Milestone: ---
Assignee: Xindice Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 11:17 UTC by sanjay
Modified: 2005-02-14 15:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sanjay 2005-02-08 11:17:09 UTC
I need to programmatically create a collection hierarchy. On the disk it creates
all the child directories in db. Also it doesnt give any error while creating. 
Any subsequent call to access the child collections fails, but parent collection
is accessible. 

I am using xidice embedded in servlet ...
here is code snippet 
---------------------------------

     Collection prjCol = createCollection(col, projectName);
     if( null == prjCol ){
           throw new Exception("");
     }
     Collection iformsCol = createCollection(prjCol, "forms");
     if( null ==  iformsCol){
           throw new Exception("");
                    }
     iformsCol.flushSymbolTable();
     iformsCol.close();
                                                                               
                                                              
     Collection dataCol = createCollection(prjCol, "data");
     if( null == dataCol ){
       throw new Exception();
      }
      dataCol.flushSymbolTable();
      dataCol.close();
                                                                               
                                                              
     Collection reportsCol = createCollection(prjCol, "reports");
     if( null == reportsCol ){
         throw new Exception("");
     }
     reportsCol.flushSymbolTable();
     reportsCol.close();
                                                                               
                                                              
     prjCol.flushSymbolTable();
     prjCol.close();
                                                                               
                                                              
     col.close();
----- create collection method ----------

public Collection createCollection(Collection parent, String name) throws
DBException{

        Document doc = new DocumentImpl();
                                                                               
                                                                      Element
colEle = doc.createElement("collection");
        colEle.setAttribute("compressed", "true");
        colEle.setAttribute("name", name);
        doc.appendChild(colEle);
                                                                               
                                                              
        Element filEle = doc.createElement("filer");
        filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
        colEle.appendChild(filEle);
                                                                               
                                                              
        Configuration cfg = new Configuration ( doc, false );
        Collection newCol =     parent.createCollection(name , cfg);
                                                                               
                                                              
        return newCol ;
                                                                               
                                                                  }
Comment 1 Vadim Gritsenko 2005-02-15 00:38:05 UTC
config has not been always saved properly; fixed in cvs

*** This bug has been marked as a duplicate of 28783 ***