Added anti lock mechanism on database functions. Added some validation to the... See merge request !280