removing table locking from prepared statements