Release lock;Save sqlcode