Modified read-only queries on Middleware to handle locks.
Added exceptions to RMs in order to control the flow of transactions in case of deletion.