Hi,
I have updated the wiki page, maybe this is the problem:
"Objects in the data store are only removed when they are not
reachable (that means, objects referenced in the cache or in memory
are not collected)"
To clean the cache, you probably have to close the repository (logout
all sessions) and then log in again. To un-reference objects in memory
you can try calling System.gc() (but this will not always work).
Why do you need to delete the files quickly?
> I am using a MemoryDatastore
Sounds interesting... Did you write it? Did you consider donating it
to Jackrabbit? You don't have to, but probably it would be interesting
for others as well.
Regards,
Thomas
On Tue, May 13, 2008 at 4:39 PM, ehsavoie <[EMAIL PROTECTED]> wrote:
>
> 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:[EMAIL PROTECTED]
> > Gesendet: Dienstag, 13. Mai 2008 15:33
> > An: [email protected]
> > 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.
>
>