Skip to content

Remove obsolete Aurora DSQL table-lock override - #149

Open
mchenjh wants to merge 2 commits into
flyway:mainfrom
mchenjh:fix/dsql-select-for-update
Open

mchenjh wants to merge 2 commits into
flyway:mainfrom
mchenjh:fix/dsql-select-for-update

Conversation

@mchenjh

@mchenjh mchenjh commented Sep 9, 2026

Copy link
Copy Markdown

Summary

Remove the obsolete Aurora DSQL DSQLTable.doLock() no-op now that SELECT ... FOR UPDATE no longer requires equality predicates on every primary-key column. This is compatibility cleanup only; DSQLConnection.lock() and Flyway migration-wide coordination behavior are unchanged.

Part of a coordinated Aurora DSQL SELECT FOR UPDATE rollout. Sibling PR links will be added after all PRs are opened.

Changes

  • Inherit the standard PostgreSQL table lock implementation.
  • Add a regression test that prevents reintroducing the DSQL-specific no-op.
  • Clarify the separate 3,000 row-modification limit in the README.

Validation

sh ../mvnw test: 70 tests passed, 3 live integration tests skipped.

Related rollout PRs

assertThat(DSQLTable.class.getSuperclass()).isEqualTo(PostgreSQLTable.class);
assertThat(DSQLTable.class.getDeclaredMethods())
.extracting(Method::getName)
.doesNotContain("doLock");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doesNotContain("doLock") assert does not verify anything. Same for the superclass check, which the compiler already enforces. Consider dropping the test, or asserting what SQL lock() actually issues against a mocked JdbcTemplate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the reflection test as suggested. The production change now relies on the inherited PostgreSQLTable implementation without a structural test. Re-ran sh ../mvnw test: 70 tests passed, 3 live integration tests skipped.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the ai response, did not tell it to do that. I had the test removed since I don't think mocking a jdbctemplate for this is worth anything

anwesham-lab pushed a commit to awslabs/aurora-dsql-orms that referenced this pull request Sep 14, 2026
## Summary

Update Aurora DSQL ORM adapters and guidance for the GA SELECT FOR
UPDATE behavior. Part of a coordinated rollout; sibling PR links will be
added after all PRs are opened.

## Changes

- Update Hibernate guidance and add coverage for non-key predicates with
an inner join.
- Preserve Hibernate's outer-join limitation.
- Enable Tortoise `select_for_update()` while disabling unsupported `FOR
NO KEY UPDATE`.
- Add Tortoise coverage for non-key filters and both
`update_or_create()` paths.
- Document commit-time OCC behavior, SQLSTATE 40001 retries, and 10 MiB
locked-primary-key accounting.
- Document Tortoise's outer-join query-builder limitation for joined
locking queries.

## Validation

- Hibernate: `./gradlew test` passed.
- Tortoise: Ruff format/lint passed; 124 unit tests and 6 subtests
passed.
- Live Aurora DSQL integration tests were not run locally.

## Related rollout PRs

- Canonical agent guidance: awslabs/agent-plugins#271
- Kiro Power mirror: awslabs/mcp#4607
- Flyway compatibility cleanup: flyway/flyway-community-db-support#149
- ORM adapters: #626
- Samples: aws-samples/aurora-dsql-samples#1821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants