1.45.1. Methods of DBCleanerService

Note

Code that invokes the methods of DBCleanService must have JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION permission.

There are several methods of DBCleanerService :

public static void cleanWorkspaceData(WorkspaceEntry wsEntry)Clean workspace data from database
public static void cleanRepositoryData(RepositoryEntry repoEntry)Cleanup repository data from database
public static DBCleaner getWorkspaceDBCleaner(Connection jdbcConn, WorkspaceEntry wsEntry)Returns database cleaner of workspace.
public static DBCleaner getRepositoryDBCleaner(Connection jdbcConn, RepositoryEntry repoEntry)Returns database cleaner of repository. Returns null in case of multi-db configuration.

The cleaning is a part of restoring from backup and it is used in the following restore phases:

clean
dbCleaner.executeCleanScripts();
restoredoes nothing with DBCleaner
commit
dbCleaner.executeCommitScripts();

connection.commit();
rollback
connection.rollback();


dbCleaner.executeRollbackScripts();
connection.commit();

Different approaches are used for database cleaning depending on database and JCR configuration.

Copyright ©2012. All rights reserved. eXo Platform SAS