Skip to content

Conversation

@eramongodb
Copy link
Contributor

Resolves CXX-3237 and CXX-3238 for the v1::transaction component.

Unlike recently-reviewed PRs, the v_noabi::options::transaction class does not contain T const& getters, thus it can be fully reimplemented in terms of v1::transaction. However, unlike previously-reviewed PRs for classes which were reimplemented in terms of v1, this is the first class which may throw an "invalid object" exception for the assign-or-destroy-only state. In order to preserve v_noabi API backward compatibility while respecting the v1 API's own assign-or-destroy-only invariants, the check_moved_from() helper implements the null check by reusing the (unchecked) raw pointer returned by the v1 as_mongoc() internal helper function. This pattern will also used by upcoming components/PRs for other classes which may throw an "invalid object" exception for backward compatibility (that is, classes which have a potentially-throwing _get_impl() helper).

@eramongodb eramongodb requested a review from kevinAlbs December 5, 2025 21:33
@eramongodb eramongodb self-assigned this Dec 5, 2025
@eramongodb eramongodb requested a review from a team as a code owner December 5, 2025 21:33
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.

1 participant