[DOCS-12709] Java transaction example is incorrect Created: 17/May/19  Updated: 30/Oct/23  Resolved: 17/May/19

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 4 years, 38 weeks, 5 days ago
Epic Link: DOCSP-1769

 Description   

Description

On https://docs.mongodb.com/master/core/transactions/#transactions-in-applications, in the Java tab, the code sample is wrong.

Insead of

        coll1.insertOne(new Document("abc", 1));
        coll2.insertOne(new Document("xyz", 999));

it should be

        coll1.insertOne(clientSession, new Document("abc", 1));
        coll2.insertOne(clientSession , new Document("xyz", 999));

I'm not sure where the source for this code lives. I thought it would be in the Java driver repository, but I don't see it there.

Thanks to shane.harvey for spotting this.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 17/May/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12709: fix new java txn code
Branch: master
https://github.com/mongodb/docs/commit/c97c14cc121f5fa02382d7cef7805293066df4e6

Generated at Thu Feb 08 08:05:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.