sqlx
sqlx copied to clipboard
improve docs: Transactions can use up connection pool
Is your feature request related to a problem? Please describe. AFAIK, a connection can only run one transaction. So I conclude that in async, if multiple transactions are running, the connection pool can be fully occupied, which could lead to unexpected/hard-to-debug slowness in a system with a small connection pool that otherwise has good performance.
It may also make sense to recommend explicit rollback rather than relying on Drop. See this. IIUC, the async nature could mean that Drop is delayed, which can cause further slowness. I've not confirmed this though, but it seems plausible.
I suggest that this should be emphasized/documented at: https://docs.rs/sqlx/latest/sqlx/struct.Transaction.html