Ditto Sam's response above. First off, make sure you need to be locking, and attempt to minimize the locking done. If possible (depends on engine type being used), you want to lock only those records that are being updated/written, not the whole table(s). And you don't want to lock at all if/when reading the database.
Locking/Unlocking pieces and parts of databases is an underrespected art, read lots, tread carefully.
-Scott