This article was originally published on Jo4 Blog . I'll cut to the chase: if you have a counter column, a @Modifying @Query that increments it, and a @Version field on the same entity, you almost certainly have a silent data-loss bug. We had this exact bug.

Source: [Dev.to](https://dev.to/anand_rathnas_d5b608cc3de/why-your-jpa-counter-column-keeps-resetting-to-zero-2inh)

Sponsored