Hi,
I’m using liquibase (build from trunk 2 months ago) to do data backup in a web application (jboss-web server with spring and richfaces).
When the backup is proceeded I call LockService.getInstance(database).waitForLock();
and after the backup is finished I call
- } finally {
try {
LockService.getInstance(database).releaseLock();
} catch (LockException e) {
}
if (liquibase != null) {
liquibase.forceReleaseLocks();
}
-
LockService lockService = LockService.getInstance(createDatabase(connection));
DatabaseChangeLogLock[] listLocks = lockService.listLocks();
if (null != listLocks && listLocks.length > 0) {
return true;
}
I have some performance issues and I tracked down (yourkit) that this check takes 51% from the CPU time of the request. After detailed investigation I see that createDatabase() takes 16% and listLocks() takes 36% from the total request CPU time. After going down in the call list
createDatabase() -> … -> liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry() takes 16%
and listLocks() -> com.mysql.jdbc.Statement.executeQuery(String) takes 19%
listLocks() -> java.util.jar.JarInputStream.getNextJarEntry() takes another 17%
So from these 51% - 19% (967 ms) are used to open the connection and check if there are locks and 16% + 17% ~ 32% are used for liquibase.servicelocator.ResolverUtil.listClassResources(JarInputStream, String) -> java.util.jar.JarInputStream.getNextJarEntry()
Is there any chance to minimize these 32%?