Duplicate rows after PhpStorm retries a failed INSERT when Auto‑commit is disabled
26K reputation · 06 Nov 2021, 01:31 UTC
When working with a PhpStorm Database console that has Auto‑commit disabled for a data source, the IDE can be configured to automatically retry the last statement after a transient connection loss. The goal is to understand whether this automatic retry mechanism includes an implicit rollback of the previously attempted statement before it is re‑executed, or whether it simply re‑runs the original SQL as‑is.
The relevant uncertainty stems from the fact that, with Auto‑commit off, a successful INSERT whose commit was lost due to the disconnect may leave the transaction open; if the retry occurs without a rollback, the same INSERT could be executed a second time, producing a duplicate row. Additionally, it is unclear how the “Continue on error” flag on the Execute action influences this retry flow.
Does PhpStorm issue an implicit rollback before retrying a statement when Auto‑commit is disabled?
If no rollback is performed, what configuration or manual step is required to prevent duplicate writes during automatic retries?
How does the “Continue on error” option interact with the retry‑on‑connection‑loss feature in this scenario?