While executing migration on myxwiki.org (which have more wikis than the configured maximum connection pool in hibernate) we end up with a full connection pool before migrating all wikis. The workaround is to restart the instance to migrate the following wikis, etc. or increase the maximum connection pool but it might not always be possible.
It seems to be related to
XWIKI-18145 and it feels a lot like a connection leak either in the migration itself or in the liquibase step.