Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hikari support for TRANSACTION_LAST_COMMITED and TRANSACTION_CURSOR_STABILITY #1950

Open
liamsorsby opened this issue Jul 13, 2022 · 0 comments

Comments

@liamsorsby
Copy link
Contributor

Using the Informix jdbc plugin we have a use case where we need to use TRANSACTION_LAST_COMMITED however that doesn't look like it's support in the enum
https://github.com/brettwooldridge/HikariCP/blob/dev/src/main/java/com/zaxxer/hikari/util/IsolationLevel.java#L19
Documentation of the allowed Isolation Levels here: https://www.ibm.com/docs/en/informix-servers/12.10?topic=database-informix-environment-variables-informix-jdbc-driver

The map to the following:

0 Equivalent to TRANSACTION_NONE
1 Dirty Read (equivalent to TRANSACTION_READ_UNCOMMITTED),
2 Committed Read (equivalent to TRANSACTION_READ_COMMITTED),
3 Cursor Stability (equivalent to TRANSACTION_READ_COMMITTED),
4 Repeatable Read (equivalent to TRANSACTION_REPEATABLE_READ)
5 Committed Read LAST COMMITTED (equivalent to TRANSACTION_LAST_COMMITTED)
8 Equivalent to TRANSACTION_SERIALIZABLE

Would there be any objection to implementing the missing ENUM's or was there a reason they weren't added?

3 Cursor Stability (equivalent to TRANSACTION_READ_COMMITTED),
5 Committed Read LAST COMMITTED (equivalent to TRANSACTION_LAST_COMMITTED)
liamsorsby pushed a commit to liamsorsby/HikariCP that referenced this issue Jul 14, 2022
…and TRANSACTION_LAST_COMMITTED

TRANSACTION_LAST_COMMITTED - This allows a readonly user to access a row and read the last commited data while Informix has an open lock against the data.
Unlike TRANSACTION_READ_UNCOMMITTED which would also accomplish the same but would end up allowing dirty reads. This would lead to us reading data that's potentially either rolledback or never actually commited.

TRANSACTION_CURSOR_STABILITY - Cursor stability will place a lock on a row as it's fetched which ensures that the data doesn't change while the program reads the data.
Documentation for cursor stability can be found here https://www.ibm.com/docs/en/informix-servers/12.10?topic=level-informix-cursor-stability-isolation

Documentation on Informix transaction isolation levels are here https://www.ibm.com/docs/en/informix-servers/12.10?topic=database-informix-environment-variables-informix-jdbc-driver
lfbayer pushed a commit that referenced this issue Sep 15, 2023
…_LAST_COMMITTED (#1952)

TRANSACTION_LAST_COMMITTED - This allows a readonly user to access a row and read the last commited data while Informix has an open lock against the data.
Unlike TRANSACTION_READ_UNCOMMITTED which would also accomplish the same but would end up allowing dirty reads. This would lead to us reading data that's potentially either rolledback or never actually commited.

TRANSACTION_CURSOR_STABILITY - Cursor stability will place a lock on a row as it's fetched which ensures that the data doesn't change while the program reads the data.
Documentation for cursor stability can be found here https://www.ibm.com/docs/en/informix-servers/12.10?topic=level-informix-cursor-stability-isolation

Documentation on Informix transaction isolation levels are here https://www.ibm.com/docs/en/informix-servers/12.10?topic=database-informix-environment-variables-informix-jdbc-driver

Co-authored-by: Liam Sorsby <liam.sorsby@skybettingandgaming.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant