How does LockModeType.OPTIMISTIC work in JPA and Hibernate

Explicit optimistic locking In my previous post, I introduced the basic concepts of Java Persistence locking. The implicit locking mechanism prevents lost updates and it’s suitable for entities that we can actively modify. While implicit optimistic locking is a widespread technique, few happen to understand the inner workings of explicit optimistic lock mode. Explicit optimistic locking may prevent data integrity anomalies when the locked entities are always modified by some external mechanism.

How to get a 10,000 points StackOverflow reputation

How it all started Since I started the Hibernate Master Class project, focusing on best practices and well-established usage patterns. I then realized that all my previous Hibernate experience wouldn’t be enough for this task. I needed more than that. Hibernate has a very steep learning curve and tens of new StackOverflow questions are being asked on a daily basis. With so many problems waiting to be solved, I came to realize this was a great opportunity to prove my current skills while learning some new tricks. On 8th of May 2014,… Read More

A beginner’s guide to Java Persistence locking

Implicit locking In concurrency theory, locking is used for protecting mutable shared data against hazardous data integrity anomalies. Because lock management is a very complex problem, most applications rely on their data provider implicit locking techniques. Delegating the whole locking responsibility to the database system can both simplify application development and prevent concurrency issues, such as deadlocking. Deadlocks can still occur, but the database can detect and take safety measures (arbitrarily releasing one of the two competing locks).

Why you should pay developers to learn

A true story We were having a meeting with a customer and he had just presented a project idea. He wanted us to give him a draft system architecture, supporting his project technical requirements. At one point, I was telling him that incremental development requires architecture evolution as well. When I said that finding the right architecture is also a learning process, he cut me off short of the following sentence: Do you expect me to pay you to learn? To save the day, I told him I was referring to the… Read More

Book review – How Linux Works 2nd edition

The book The book’s author is Brian Ward, who has a Ph.D. in computer science and has written several books about Linux Kernel, Vim, and VMware. The book has 17 Chapters and covers many Linux aspects, from the Operating System architecture to Bash scripting and Package Managers.