Distrubute Transaction

16 views
Skip to first unread message

L B

unread,
Nov 5, 2019, 7:27:36 AM11/5/19
to mongodb-go-driver
Hi all:

I'm a newer. I have some concerns about "Distribution Transactions" in v4.2.

1. Does this mean that several client can start a session with the same session id ? and operations like find/insert can in the same transaction?
2. Dose mongodb requite the transactions must in the same session, and a same connections.

I have read mongodb docs about this, but i can not find this ansower.

Any explainations is greatful, thanks.

David Golden

unread,
Nov 5, 2019, 7:32:22 AM11/5/19
to mongodb-...@googlegroups.com
Hi, LB.
This group is intended for questions specific to the MongoDB Go driver.  General questions are best asked on the mongodb-user group or on Stackoverflow.

That said, to your questions:
(1) Distributed transaction means that a single client can execute a transaction that spans multiple shards in a sharded cluster.  All shards commit or abort the transaction.
(2) A transaction requires a single client to use a single session to start the transaction.  Connections for a transaction are managed appropriately in the background depending on your topology (it's different for a replica set or sharded cluster).

Regards,
David


--
You received this message because you are subscribed to the Google Groups "mongodb-go-driver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-go-dri...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-go-driver/bced3cec-bfb1-477c-8367-2998e68ab859%40googlegroups.com.

L B

unread,
Nov 8, 2019, 10:47:25 PM11/8/19
to mongodb-go-driver
thanks.

在 2019年11月5日星期二 UTC+8下午8:32:22,David Golden写道:
Hi, LB.
This group is intended for questions specific to the MongoDB Go driver.  General questions are best asked on the mongodb-user group or on Stackoverflow.

That said, to your questions:
(1) Distributed transaction means that a single client can execute a transaction that spans multiple shards in a sharded cluster.  All shards commit or abort the transaction.
(2) A transaction requires a single client to use a single session to start the transaction.  Connections for a transaction are managed appropriately in the background depending on your topology (it's different for a replica set or sharded cluster).

Regards,
David


On Tue, Nov 5, 2019 at 7:27 AM L B <lxiaop...@126.com> wrote:
Hi all:

I'm a newer. I have some concerns about "Distribution Transactions" in v4.2.

1. Does this mean that several client can start a session with the same session id ? and operations like find/insert can in the same transaction?
2. Dose mongodb requite the transactions must in the same session, and a same connections.

I have read mongodb docs about this, but i can not find this ansower.

Any explainations is greatful, thanks.

--
You received this message because you are subscribed to the Google Groups "mongodb-go-driver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages