Tag: locking


  • Conquering Concurrency: Pessimistic Locking in Spring Boot

    In the bustling world of multi-user applications, ensuring data integrity becomes paramount. When multiple users contend for the same resource, conflicts can arise, leading to lost updates and unintended side effects. Here’s where pessimistic locking steps in, acting as a valiant knight guarding data consistency in Spring Boot applications. What is Pessimistic Locking? Imagine two…

  • Object level lock vs Class level lock in Java

    In Java, a synchronized block of code can only be executed by one thread at a time. Also, java supports multiple threads to be executed concurrently. This may cause two or more threads to access the same fields or objects at the same time. Synchronization is the process which keeps all concurrent threads in execution to…