jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paco Avila <monk...@gmail.com>
Subject problems running DataStore Garbage Collector
Date Mon, 09 Mar 2009 18:45:18 GMT
I run this code every 5 minutes (the first three lines get the session of a
SuperUser internal application session):

try {
            SessionManager sm = SessionManager.getInstance();
            String sysToken = sm.getSystemToken();
            SessionImpl si = (SessionImpl)sm.get(sysToken);
            GarbageCollector gc = si.createDataStoreGarbageCollector();

            // optional (if you want to implement a progress bar / output)
            gc.setScanEventListener(this);
            gc.scan();
            gc.stopScan();

            // delete old data
            int deleted = gc.deleteUnused();
            log.info("Deleted garbage documents: "+deleted);
        } catch (IOException e) {
            log.error(e.getMessage(), e);
        } catch (IllegalStateException e) {
            log.error(e.getMessage(), e);
        } catch (ItemStateException e) {
            log.error(e.getMessage(), e);
        } catch (RepositoryException e) {
            log.error(e.getMessage(), e);
        }

but it never remove anything from the datastore. I have deleted some
document from the repository and I don't understand why they are not deleted
from the datastore. Also I have logged out from the system to verify there
is no cached references to these deleted documents.

-- 
Paco Avila
GIT Consultors
tel: +34 971 498310
fax: +34 971496189
e-mail: pavila@git.es
http://www.git.es

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message