Added a little functionality with the locks and also added lock query for SQLite.