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

Fix #1803: Ensure the getOperation doesn't change operation status #1804

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

zcgandcomp
Copy link
Member

No description provided.

Copy link
Member

@romanstrobl romanstrobl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix, but lets improve the code style.

@@ -1013,6 +1012,17 @@ private OperationEntity expireOperation(OperationEntity operationEntity, Date cu
return operationEntity;
}

private void expireOperation(OperationDetailResponse operation, Date currentTimestamp) throws GenericServiceException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not duplicate this logic, we can reuse the code below in new private method shared by both expireOperation methods and call it to obtain status.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method changes only the response class, not the entity. I suggest to rename it to avoid confusion.

@zcgandcomp zcgandcomp requested a review from jnpsk December 13, 2024 14:23
Copy link
Member

@banterCZ banterCZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work. Before, the status at the JPA entity level and the hibernate dirty checking caused the problem. Now, the response status has only been changed. The transaction cannot be converted to read-only because of the claim functionality.

Copy link
Collaborator

@jnpsk jnpsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok.

@zcgandcomp zcgandcomp marked this pull request as ready for review December 13, 2024 15:00
@zcgandcomp zcgandcomp merged commit 3f949a7 into releases/1.8.x Dec 13, 2024
2 checks passed
@zcgandcomp zcgandcomp deleted the issues/1803-getdetail-read-only branch December 13, 2024 15:02
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.

4 participants