Database lock checking implemented - closes #70