Lock test on database (using fork)