Don't create lock object if not needed.
#PLAT-718
Merge pull request #674 from kaltura/IX-9.7.0-batch

Don't create lock object if not needed.