Concurrent goroutines and mutex with mongodb-go-driver

341 views
Skip to first unread message

Marco Bisetto

unread,
Nov 13, 2019, 9:02:30 AM11/13/19
to mongodb-go-driver
Hi,

Is it safe to use concurrently a mongo.Client connection in multiple goroutines without guarding it with a mutex?

Regards.
Marco

David Golden

unread,
Nov 13, 2019, 9:04:23 AM11/13/19
to mongodb-...@googlegroups.com
Yes.  It's safe to use Client, Database and Collection objects concurrently.  Sessions/Transactions are not safe.

--
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/bc7bb202-c14c-4267-b156-4ce4abfdae04%40googlegroups.com.

Marco Bisetto

unread,
Nov 14, 2019, 5:12:33 AM11/14/19
to mongodb-go-driver
Solved.
Thank you.
Reply all
Reply to author
Forward
0 new messages