alaisi / postgres-async-driver

Asynchronous PostgreSQL Java driver
Apache License 2.0
287 stars 38 forks source link

Support for nested transactions. #37

Closed haraldnh closed 7 years ago

haraldnh commented 7 years ago

As suggested in #36, it seems useful to support nested transactions.

These changes moves the functionality of the TransactionExecutor interface (begin()) into the QueryExecutor interface, allowing any QueryExecutor (currently a Db/Connection or a Transaction) to start a new transaction.

This makes it easier to write generalized code, a QueryExecutor can be passed in, and a (sub-)transaction can be run using it regardless of what happens before/after the function is called.

haraldnh commented 7 years ago

Let me close this one, and create a new based on a properly named branch and with the commits squashed together.