A deep dive into MySQL's locking reads (SELECT FOR SHARE and SELECT FOR UPDATE) and how to implement them in Adobe ColdFusion 2025. The post explains the difference between shared and exclusive row locks using InnoDB, covers gap locking behavior, and shows a practical layered architecture where Gateway components accept a withLock argument, Model components pass it through, and Service components make locking decisions within transaction blocks. Real code examples from the Big Sexy Poems project illustrate create, update, and delete workflows with appropriate lock types, and the author emphasizes that row locking only works when all workflows in the application agree to the same locking strategy.
Table of contents
MySQL Locking ReadsAdding Locking Mechanics To My Data Access LayerServices As The Transaction Orchestration LayerLocking Simple Updates FOR UPDATEA Little Magic And a Lot Of Mutual AgreementYou Might Also Enjoy Some of My Other PostsReader CommentsSort: