Shared lock "s lock"
Also known as read lock, if the transaction T on the data object a plus s lock, then transaction T can read a but can not modify a, other transactions can only be a plus s lock, but not x lock, until T release a on the S lock. This ensures that other transactions can read a, but cannot make any changes to a before T releases the S lock on a.
Exclusive lock "x lock"
Also known as write locks. If a transaction t is an X lock on a data object A, transaction t can read a or modify a, and the other transaction can no longer lock on a, until T releases the lock on A. This ensures that other transactions can no longer read and modify a when T releases a lock on a.
Above from: http://blog.csdn.net/yuwei19840916/article/details/3245107
Role:
Shared locks: Prevents data being read by the current transaction from being modified by other transactions.
Exclusive lock: Prevents data from being modified by the current transaction from being read by other transactions, preventing other transactions from reading dirty data.