arenadotio / pgx

A pure OCaml PostgreSQL client library
Other
122 stars 16 forks source link

Add transaction sub-sequencer #99

Closed brendanlong closed 2 years ago

brendanlong commented 4 years ago

This ensures that if you start a transaction, other queries outside of it have to wait for the transaction to finish.

For example, if you do:

let%bind _ = Pgx_async.with_transaction (...)
and _ = Pgx_async.execute ...

This will now guarantee that the execute happens outside of the transaction (either before or after it, but not during).

brendanlong commented 4 years ago

I guess we probably also need the deadlock detection we added in Mssql: https://github.com/arenadotio/ocaml-mssql/blob/master/src/client.ml#L28

gtrak commented 2 years ago

These are things we might potentially want, but they need more work and testing to get over the finish line. Closing for now.