user query causes database locke