TD provides an own locking layer to be independent of the used database and to allow locks active cross multiple database transactions.
To understand the different aspects there are multiple interesting articles available.