paint-brush
Optimistic and Pessimistic Locking in JPAby@yaf
52,851 reads
52,851 reads

Optimistic and Pessimistic Locking in JPA

by Fedor Yaremenko15mMarch 1st, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

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
Fedor Yaremenko

Fedor Yaremenko

@yaf

10+ years Java developer

About @yaf
LEARN MORE ABOUT @YAF'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Fedor Yaremenko HackerNoon profile picture
Fedor Yaremenko@yaf
10+ years Java developer

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite