Decoding Pessimistic Locking: Ensuring Data Integrity in Concurrent Applications

The previous post discussed the “Optimistic Logic” and how Hibernate implements it. This new post will discuss the “Pessimistic Logic” technique and how to implement it using Hibernate. What is the Pessimistic Locking? Locking is a critical concept in the world of databases and transaction management. As the name suggests, Pessimistic Locking takes a conservative … Read moreDecoding Pessimistic Locking: Ensuring Data Integrity in Concurrent Applications

Optimistic Locking – How Hibernate implements it

In the previous post, we discussed the theory behind the indexes used in a DBMS to improve the data searching on a database table. This new post will discuss the “Optimistic Logic” technique and how to implement it using Hibernate. What is the Optimistic Locking? Optimistic Locking is a technique used in computer science to … Read moreOptimistic Locking – How Hibernate implements it

Transaction in JAVA: from JDBC to Spring @Transactional and TransactionTemplate

Spring @Transactional

In this reading, we are going to understand how transactions are handled in a plain old JDBC transaction management and, later, how Spring Framework’s declarative transaction management is made possible with Spring aspect-oriented programming (AOP) (official Spring documentation). In the final part, we are also going to talk about TransactionTemplate!