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

bugfix: fix can't rollback when set rollback retry count was zero. #2777

Merged
merged 9 commits into from
Jun 9, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void commit() throws TransactionException {
return;
}
assertXIDNotNull();
int retry = COMMIT_RETRY_COUNT;
int retry = COMMIT_RETRY_COUNT <= 0 ? 1 : COMMIT_RETRY_COUNT;;
Copy link
Member

Choose a reason for hiding this comment

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

Is it better to use the default value when <=0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

try {
while (retry > 0) {
try {
Expand Down Expand Up @@ -156,7 +156,7 @@ public void rollback() throws TransactionException {
}
assertXIDNotNull();

int retry = ROLLBACK_RETRY_COUNT;
int retry = ROLLBACK_RETRY_COUNT <= 0 ? 1 : ROLLBACK_RETRY_COUNT;
try {
while (retry > 0) {
try {
Expand Down