-
Notifications
You must be signed in to change notification settings - Fork 27
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
CORE-19229 - Remove transactions from StateManager read operations. #5401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR title failed to match regex -> ^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5|DI)-\d+)(.*)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR title failed to match regex -> ^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5|DI)-\d+)(.*)
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Jenkins build for PR 5401 build 1 Build Successful: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, whether a read operation executes within an explicit transaction or not, it still runs within a transaction context. The database implicitly starts a transaction for each statement, even if it's not explicitly wrapped in a BEGIN
and COMMIT
block. This is a standard behavior in PostgreSQL (PostgreSQL Transactions Documentation).
Secondly, regarding the default isolation level, our specification in Corda is set to Read Committed
( Corda Runtime OS - TransactionIsolationLevel.kt). This matches the default isolation level of PostgreSQL, which is also Read Committed
. Therefore, from a data integrity perspective, using the default settings does not compromise the data integrity here.
Regarding the intention to remove the transaction for the read operation, using use { ... }
might indeed be more efficient and simpler, potentially leading to some performance gains. While the impact might be minimal for a few statements, it could be more measurable for a large number of select queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.