# Is counter\_cache transaction safe?

**URL:** <https://www.ruby-forum.com/t/is-counter-cache-transaction-safe/114981>\
**Category:** Rails\
**Created:** [September 19, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/is-counter-cache-transaction-safe/114981 "2007-09-19T13:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dae\_San\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@Dae\_San\_H](https://www.ruby-forum.com/u/Dae_San_H)\
**Post date:** [September 19, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/is-counter-cache-transaction-safe/114981/1 "2007-09-19T13:36:42Z")

</div>

In one of the web applications I’ve developed, counter\_cache get out  
of sync from time to time.

Doesn’t the counter method lock the row of the parent table before  
inserting new record into the child table?

daesan.
