exclusive schema lock error check in cleanup and flush methods