Changed lock tables to transactions