jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehsavoie <ehsavoi...@gmail.com>
Subject Re: AW: Removing content
Date Tue, 13 May 2008 14:39:04 GMT

It doesn't seem to work :((
Here is my code 


session = repository.login(new SimpleCredentials(
          attachment.getWorkerId(), new char[0]));
      Node rootNode = session.getRootNode();
      Node fileNode = rootNode.getNode(attachment.getJcrPath(language));
      Node contentNode = fileNode.getNode(JcrConstants.JCR_CONTENT);
      contentNode.remove();
      fileNode.remove();
      session.save();
      GarbageCollector gc = ((org.apache.jackrabbit.core.SessionImpl)
session)
          .createDataStoreGarbageCollector();
      if (gc != null && gc.getDataStore() != null) {
        gc.scan();
        gc.stopScan();
        gc.deleteUnused();
      }

What am I missing ?

(the test on the gc is done because I am using a MemoryDatastore for my
JUnit tests)

KÖLL Claus wrote:
> 
> hi if you are using the datastore
> you must start the garbage collector
> 
> @see http://wiki.apache.org/jackrabbit/DataStore
> 
> BR,
> claus
> 
> -----Ursprüngliche Nachricht-----
> Von: Emmanuel Hugonnet [mailto:ehsavoie73@gmail.com] 
> Gesendet: Dienstag, 13. Mai 2008 15:33
> An: users@jackrabbit.apache.org
> Betreff: Removing content
> 
> 
> Hi,
> I have a nt:file node with its jcr:content child. When I remove my node 
> (node.remove()) it is correctly removed but the content is still on my 
> filesystem :( in the repository/datastore/....
> How do I delete the content ?
> Emmanuel
> 
> 

-- 
View this message in context: http://www.nabble.com/Removing-content-tp17208567p17210140.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message