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

Database – Data Concurrency, Data Consistency and Isolation Level

In the previous posts, we read about database transactions and how we can manage them in Java and PHP on different layers. In this post, we will read about data concurrency/consistency and figure out how to properly set the isolation level of an explicit DBMS transaction. We will see several examples using three distinct RDBMS: … Read moreDatabase – Data Concurrency, Data Consistency and Isolation Level

Transaction in PHP: from Mysqli to PDO and Doctrine transaction handling

Starting from ACID properties, in the previous post, we have seen how transactions are handled by JDBC and by the abstracted layers written using JAVA as a programming language. What does it change if we are going to use PHP? How many layers and methodologies are provided? Let’s figure it out together! Mysqli: vendor specific … Read moreTransaction in PHP: from Mysqli to PDO and Doctrine transaction handling

Transaction: ACID Properties and CAP Theorem

Transaction

Introduction In this reading, we will explain some principles on which database transactions are based: ACID Properties (don’t forget to read about Jim GRAY) and CAP Theorem. Transaction A transaction is a single logical unit of work that reads, and possibly changes, the contents of a database. Transactions are made up of one or more … Read moreTransaction: ACID Properties and CAP Theorem