Make sure getScopedLockAndFlush() commits before unlocking