-
Notifications
You must be signed in to change notification settings - Fork 11
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
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.
Good fix, but lets improve the code style.
...o/getlime/security/powerauth/app/server/service/behavior/tasks/OperationServiceBehavior.java
Outdated
Show resolved
Hide resolved
@@ -1013,6 +1012,17 @@ private OperationEntity expireOperation(OperationEntity operationEntity, Date cu | |||
return operationEntity; | |||
} | |||
|
|||
private void expireOperation(OperationDetailResponse operation, Date currentTimestamp) throws GenericServiceException { |
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.
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.
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.
This method changes only the response class, not the entity. I suggest to rename it to avoid confusion.
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.
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.
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.
Looks ok.
No description provided.