go-txdb icon indicating copy to clipboard operation
go-txdb copied to clipboard

README: add/explain SetMaxOpenConns(1)

Open stapelberg opened this issue 1 year ago • 2 comments

Concurrent transactions are unsupported by txdb.

related to issue #69

stapelberg avatar Oct 16 '24 11:10 stapelberg

Thanks for the PR. My concern with this is that I think it's overly prescriptive. It's not always adviseable to set max connections to 1. It depends a lot on your application. I think some additional explanation is warranted. I'll see if I can find some time to do that, if you don't get to it first.

flimzy avatar Oct 16 '24 18:10 flimzy

Thanks for the PR. My concern with this is that I think it's overly prescriptive. It's not always adviseable to set max connections to 1. It depends a lot on your application. I think some additional explanation is warranted. I'll see if I can find some time to do that, if you don't get to it first.

I’m not sure why setting max connections to 1 isn’t a good default. Over in issue #69 you mentioned that this could lead to deadlocks in certain applications, but I’m not sure under which conditions exactly. (And probably a deadlock is easier to debug than the current flakyness.)

Feel free to modify the PR directly, or merge and adjust as you see fit.

stapelberg avatar Oct 17 '24 00:10 stapelberg