r10299: remove the public (un)lock functions and introduce a transaction based