Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-43095: Transactions #59

Merged
merged 8 commits into from
Oct 9, 2024

Conversation

mcmorisi
Copy link
Collaborator

@mcmorisi mcmorisi commented Sep 30, 2024

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-43095
Staging - https://deploy-preview-59--docs-c.netlify.app/write/transactions/

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for docs-c ready!

Name Link
🔨 Latest commit 4920937
🔍 Latest deploy log https://app.netlify.com/sites/docs-c/deploys/6706d1b78aa1cd0008cb3e7e
😎 Deploy Preview https://deploy-preview-59--docs-c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mcmorisi mcmorisi marked this pull request as ready for review September 30, 2024 19:27
Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

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

Few things I noticed upon inspection:

  1. I got some relevant technical feedback on the transactions pg for PHP driver. I think using that page as a template for this page would use the most up to date and technically correct info about transactions.
  2. It would be best to show an example that uses the Convenient transactions API instead of the manual (core) API, unless requested by the C dbx team. This API uses the mongoc_client_session_with_transaction() method.
  3. The transactions example is most useful if it shows a common use case such as committing changes across multiple collections. It is a slight improvement to the example that would more closely match the use case for many users. see PHP page for an example you might want to adapt.

Let me know if you have any questions about this feedback! I'll wait to leave a more detailed review in the next round.

@mcmorisi mcmorisi requested a review from rustagir October 1, 2024 15:58
Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for implementing that feedback quickly.

source/write/transactions.txt Outdated Show resolved Hide resolved
source/write/transactions.txt Outdated Show resolved Hide resolved
@mcmorisi mcmorisi requested a review from kevinAlbs October 1, 2024 18:53
@kevinAlbs kevinAlbs requested review from adriandole and removed request for kevinAlbs October 1, 2024 19:37
mongoc_collection_t *savings = mongoc_client_get_collection (client, "sample_bank", "savings");
mongoc_collection_t *receipts = mongoc_client_get_collection (client, "sample_bank", "receipts");

char *account_id = "123456";

Choose a reason for hiding this comment

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

Suggested change
char *account_id = "123456";
const char *account_id = "123456";

Not recommended to define non-const string literals.

// end-callback

int
main (int argc, char *argv[])

Choose a reason for hiding this comment

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

Suggested change
main (int argc, char *argv[])
main (void)

Prevent unused variable warnings by skipping argc and argv in main if they are unused.


// start-callback
bool
transaction_callback (mongoc_client_session_t *session)

Choose a reason for hiding this comment

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

Suggested change
transaction_callback (mongoc_client_session_t *session)
transaction_callback(mongoc_client_session_t *session, void *ctx,
bson_t **reply, bson_error_t *error)
{
BSON_UNUSED(ctx);
BSON_UNUSED(reply);

Declaring the full callback type prevents a function casting warning and I think it's more informative.

@mcmorisi mcmorisi requested a review from adriandole October 9, 2024 18:37
@mcmorisi mcmorisi merged commit 9e7ea78 into mongodb:standardization Oct 9, 2024
3 of 5 checks passed
@mcmorisi mcmorisi deleted the DOCSP-43095-transactions branch October 9, 2024 18:56
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