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

[#1950] Adds support for TRANSACTION_CURSOR_STABILITY and TRANSACTION_LAST_COMMITTED #1952

Conversation

liamsorsby
Copy link
Contributor

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

…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
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #1952 (427561a) into dev (ef99317) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #1952      +/-   ##
============================================
- Coverage     70.37%   70.26%   -0.12%     
+ Complexity      572      569       -3     
============================================
  Files            26       26              
  Lines          2164     2166       +2     
  Branches        311      311              
============================================
- Hits           1523     1522       -1     
- Misses          492      493       +1     
- Partials        149      151       +2     
Impacted Files Coverage Δ
...in/java/com/zaxxer/hikari/util/IsolationLevel.java 100.00% <100.00%> (ø)
...ain/java/com/zaxxer/hikari/util/ConcurrentBag.java 74.46% <0.00%> (-2.13%) ⬇️
...n/java/com/zaxxer/hikari/pool/ProxyConnection.java 77.84% <0.00%> (-0.64%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef99317...427561a. Read the comment docs.

@lfbayer
Copy link
Collaborator

lfbayer commented Jul 14, 2022

@brettwooldridge This seems reasonable to me, but presumably there are other isolation levels as well. Why stop here, is there a way to support everything without HikariCP having to know?

@liamsorsby
Copy link
Contributor Author

As the Ifxconnection extends java.sql.connection and I suspect most of them would. It might be possible to just expect an instance of java.sql.connection to be passed in. That would likely result in a breaking change though.

https://javadoc.io/static/com.ibm.informix/jdbc/4.10.9/com/informix/jdbc/IfxConnection.html

@lfbayer lfbayer merged commit d15560e into brettwooldridge:dev Sep 15, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants