Indeed, newer versions seem require to lock all tables used in the queries. For a quick solution, if you want to dig in the code, you can try to figure out if the select can be moved out. In long term, this part of code has to be updated for the new requirements.