Blog73.9K views1,972 votes0 replies4,711 following
Stop Silent Overwrites: Optimistic Locking in Yii 2 ActiveRecord
Yii 2 ActiveRecord optimistic locking prevents lost updates by adding a version column, exposing it in the form, and catching StaleObjectException as a user‑facing conflict.