Commit 0a6aa5e
* fix(migrator): skip transaction commit after rollback in migrateIndividual() (#2811)
`migrateIndividual()` issued `transaction action="commit"` unconditionally
after its try/catch — including on the error path, where the catch block
had already issued `transaction action="rollback"`. Unlike `migrateTo()`'s
loops, there is no enclosing `for` to `break` out of, so control always
fell through to the spurious commit.
On Lucee the second action against a closed transaction is a silent no-op.
On Adobe CF 2023/2025 (and potentially BoxLang) the JDBC driver may
throw a "transaction not active" error that masks the real migration
failure, making the underlying problem harder to diagnose.
Fix: return `local.rv` from inside the catch after the rollback. Mirrors
the early-exit pattern in `migrateTo()` (which uses `break` to exit its
for loop and skip the commit); here we use `return` because the
`transaction { }` block is not enclosed in a loop.
Adds a regression spec under an isolated fixture directory
(_assets/migrator-error-path/) so the synthetic always-throw migration
does not pollute the shared 001/002/003 fixtures used by every other
migrator spec.
Diagnosed by both round-1 reviewers on #2810 and explicitly recommended
as a follow-up. See issue #2811 for the full diagnosis and pattern
comparison against migrateTo().
Signed-off-by: Peter Amiri <peter@alurium.com>
* fix(migrator): address Reviewer A/B consensus findings (round 1)
- Strip issue-number prefix from the commit-skip comment in
Migrator.cfc; preserve the WHY (rollback already closed the
transaction; mirrors migrateTo()'s break) per CLAUDE.md "Don't
reference the current task".
- Strip the trailing "Issue #2811." from the synthetic fixture's
hint attribute in 004_synthetic_failing_migration.cfc.
- Strip the issue prefix from the spec's intro comment and from
the describe label in MigrateIndividualErrorPathSpec.cfc.
- Remove the duplicate afterEach block in
MigrateIndividualErrorPathSpec.cfc — beforeEach already
guarantees a clean state before every it(), so the afterEach
was a source of confusion rather than additional safety.
The var _isCockroachDB → struct-form consistency nit (Reviewer A
finding 3 / Reviewer B convergence item) was explicitly described
by both reviewers as lowest-priority "can be addressed separately
if desired" and is left for a follow-up to keep this commit
scoped to consensus-only changes.
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
---------
Signed-off-by: Peter Amiri <peter@alurium.com>
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent 39a2bbf commit 0a6aa5e
3 files changed
Lines changed: 93 additions & 0 deletions
File tree
- vendor/wheels
- tests
- _assets/migrator-error-path/migrations
- specs/migrator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 75 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments