-
Notifications
You must be signed in to change notification settings - Fork 37
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
Make Scalar DB transactions be able to abort eagerly #238
Make Scalar DB transactions be able to abort eagerly #238
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.
Thank you!
The code looks good.
I'm just wondering if we should return UNKNOWN for unsupported operations.
@@ -140,6 +140,11 @@ public TransactionState getState(String txId) { | |||
return TransactionState.UNKNOWN; // always returns UNKNOWN | |||
} | |||
|
|||
@Override | |||
public TransactionState abort(String txId) { | |||
return TransactionState.UNKNOWN; // always returns UNKNOWN |
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.
I rethought this method and getState
method.
I now think it's better to throw an exception since the application cannot rely on the APIs.
(I think, If UNKNOWN is returned, users would expect if it is returning something else sometimes or eventually)
Thought?
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.
Thank you for reviewing this!
Yes, I agree that the methods should throw an exception (UnsupportedOperationException
) in the JDBC transaction. I will fix it in that way. Thanks!
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! Thank you!
@brfrn169 Sorry, please rebuild the rpc to resolve the conflict. |
02337c9
to
d6290e9
Compare
@feeblefakie I rebased this to fix the conflicts. Please take a look at it! |
https://scalar-labs.atlassian.net/browse/DLT-9267
Please take a look!