Optimistic and Pessimistic Locking in JPAby@yaf
28,584 reads

Optimistic and Pessimistic Locking in JPA

March 1st 2022
by @yaf 28,584 reads
tldt arrow
EN
Read on Terminal Reader🖨️

Too Long; Didn't Read

Locking is a mechanism that allows parallel work with the same data in the database. When more than one transaction tries to access the same data simultaneously, locks come into play, which ensures that only one of these transactions will change the data. JPA supports two types of locking mechanisms: optimistic model and pessimistic model. We will try different kinds of locking on a Spring Data JPA application with concurrent transactional code.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Optimistic and Pessimistic Locking in JPA
Fedor Yaremenko HackerNoon profile picture

@yaf

Fedor Yaremenko

About @yaf
LEARN MORE ABOUT @YAF'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa