Skip to content

Document Connection::afterCommit() and deferred commit events#8281

Open
jamisonbryant wants to merge 2 commits into5.nextfrom
docs/connection-after-commit
Open

Document Connection::afterCommit() and deferred commit events#8281
jamisonbryant wants to merge 2 commits into5.nextfrom
docs/connection-after-commit

Conversation

@jamisonbryant
Copy link
Copy Markdown

@jamisonbryant jamisonbryant commented Apr 14, 2026

Summary

Documentation for Connection::afterCommit() and the updated behavior of afterSaveCommit/afterDeleteCommit events introduced in cakephp/cakephp#19383.

Major Changes

  • Added new afterCommit section to database-basics.md documenting Connection::afterCommit() with API signature, usage examples (basic and nested transactions), and explanation of immediate-execution semantics outside transactions
  • Updated afterSaveCommit section in table-objects.md to document the new deferred behavior when called inside outer transactions, replacing the previous "not triggered" language
  • Updated afterDeleteCommit section in table-objects.md with the same deferred behavior documentation
  • Added Changed in version 5.4.0 annotations to both event sections
  • Added entries to the 5.4 migration guide under Behavior Changes (ORM) and New Features (Database)

Minor Changes

  • Fixed typo in afterDeleteCommit description ("has been is committed" -> "has been committed")

Work Remaining

None.

Test Plan

  • Verify database-basics.html#aftercommit renders correctly with code examples and version annotation
  • Verify table-objects.html#aftersavecommit shows updated behavior description and version annotation
  • Verify table-objects.html#afterdeletecommit shows updated behavior description and version annotation
  • Verify 5.4 migration guide lists the behavior change and new feature

jamisonbryant added a commit to cakephp/cakephp that referenced this pull request Apr 14, 2026
Add Connection::afterCommit() to fix suppressed afterSaveCommit/afterDeleteCommit in outer transactions

Docs here: cakephp/docs#8281
Copy link
Copy Markdown
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to me.

explicitly set `'strategy' => 'select'` when defining associations.
See [Associations](../orm/associations#has-many-associations) for more details.
- `Model.afterSaveCommit` and `Model.afterDeleteCommit` events are now fired
when `save()` or `delete()` is called inside an outer transaction. Previously,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
when `save()` or `delete()` is called inside an outer transaction. Previously,
when `save()` or `delete()` is called within an open transaction. Previously,

🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants