Ant Group Interview Question

How to implement locks in database queries?