public static void cleanWorkspaceData ( WorkspaceEntry wsEntry ) throws DBCleanException { SecurityHelper . validateSecurityPermission ( JCRRuntimePermissions . MANAGE_REPOSITORY_PERMISSION ) ; Connection jdbcConn = getConnection ( wsEntry ) ; String dialect = resolveDialect ( jdbcConn , wsEntry ) ; boolean autoCommit = dialect . startsWith ( DialectConstants . DB_DIALECT_SYBASE ) ; try { jdbcConn . setAutoCommit ( autoCommit ) ; DBCleanerTool dbCleaner = getWorkspaceDBCleaner ( jdbcConn , wsEntry ) ; doClean ( dbCleaner ) ; } catch ( SQLException e ) { throw new DBCleanException ( e ) ; } finally { try { jdbcConn . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can not close connection" , e ) ; } } }
Cleans workspace data from database .