1.

What is meant by a locking system in JDBC?

Answer»
  • If two users are viewing the same record, then there is no issue, and LOCKING will not be DONE. If one user is updating a record and the second user also wants to update the same record, in this situation, we are going to use locking so that there will be no lost update.
  • Two types of locking are AVAILABLE in JDBC by which we can handle multiple user issues using the record. They are:
    • OPTIMISTIC Locking: It will lock the record only when an update takes place. This type of locking will not MAKE use of exclusive locks when reading or selecting the record.
    • Pessimistic Locking: It will lock the record as soon as it selects the row to update. The strategy of this locking system guarantees that the changes are made safely and consistently.


Discussion

No Comment Found