Support for locking; searching in a db