fix lock transaction with getting maxId