Preventing Duplicate Submissions in a Gym Management System
The Problem
In the gestion-nexo-gimnasio project, a gym management system, we encountered an issue where users could potentially submit duplicate attendance records due to concurrency. This could lead to inaccurate data and reporting.
The Approach
To address this, we implemented a multi-pronged approach focusing on database constraints and exception handling.
Phase 1: Unique Index Constraint
We added a unique index to the database table to prevent duplicate entries based on the