pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: prokop7 (@prokop7) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] PR #2741: feat: add transaction isolation mode
Date: Tue, 31 Jan 2023 12:43:12 +0000
Message-ID: <[email protected]> (raw)

add transaction isolation mode to be able to work with transaction pooling tools like pgbouncer

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document?
* [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### New Feature Submissions:

1. [x] Does your submission pass tests?
2. [x] Does `./gradlew autostyleCheck checkstyleAll` pass ?
3. [x] Have you added your new test classes to an existing test suite in alphabetical order?

### Transaction isolation mode
Adding this functionality discussed here https://github.com/pgjdbc/pgjdbc/issues/1880. Currently isolation level is set on connection level. This solution doesn't work with transaction pooling because the connection can be replaced after setting isolation.

Proposed solution adds transaction isolation mode, which can be on of `transaction` or `session`, by default it's session. 
If the mode set to `transaction` then all `BEGIN` statements appended with isolation level like `BEGIN ISOLATION LEVEL SERIALIZABLE`

The solution also works with READ ONLY modifier which was added in earlier versions.

Implementation requires 3 flags, one for mode (0 - session mode, 1 - transaction mode) and two for isolation level (00 - READ UNCOMMITTED, 01 - READ COMMITTED, 10 - REPEATABLE READ, 11 - SERIALIZABLE)

--- 

Solves https://github.com/pgjdbc/pgjdbc/issues/1880
Related to this PR, but it's already outdated and solved https://github.com/pgjdbc/pgjdbc/issues/848

view thread (18+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #2741: feat: add transaction isolation mode
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox