-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Use @GlobalLock get error with Response[RuntimeException[null]] #1224
Comments
Use @GlobalLock get error with Response[RuntimeException[null]]
Ⅰ. Issue DescriptionI am using @GlobalLock to execute my sql , but get a response from seata is Ⅱ. Describe what happened
Ⅲ. Describe what you expected to happenⅣ. How to reproduce it (as minimally and precisely as possible) @GlobalLock()
public Long publishArticle(PublishArticleDto publishArticleDto){
Preconditions.checkNotNull(publishArticleDto, "parameter error");
Preconditions.checkArgument(!Strings.isNullOrEmpty(publishArticleDto.getTitle()), "Article title cannot be empty");
Preconditions.checkNotNull(publishArticleDto.getUserId(), "UserId cannot be empty");
Preconditions.checkArgument(!Strings.isNullOrEmpty(publishArticleDto.getContent()), "Article content cannot be empty");
Article article = new Article();
beanMapper.map(publishArticleDto, article);
article.setArticleType(ArticleType.UPLOAD.name());
article.setStatus(ResourceStatus.ENABLE.name());
article.setArticleUrl("");
save(article);
String content = publishArticleDto.getContent();
Long articleId = article.getId();
ByteArrayInputStream contentStream = new ByteArrayInputStream(content.getBytes());
String url = uploadService.uploadArticle(String.valueOf(articleId),contentStream);
article.setArticleUrl(url);
saveOrUpdate(article);
return articleId;
} Ⅴ. Anything else we need to know?Serata config
Ⅵ. Environment:
|
I use protected T executeAutoCommitTrue(Object[] args) throws Throwable {
T result = null;
AbstractConnectionProxy connectionProxy = statementProxy.getConnectionProxy();
LockRetryController lockRetryController = new LockRetryController();
try {
connectionProxy.setAutoCommit(false);
while (true) {
try {
result = executeAutoCommitFalse(args);
connectionProxy.commit();
break;
} catch (LockConflictException lockConflict) {
connectionProxy.getTargetConnection().rollback();
lockRetryController.sleep(lockConflict);
}
}
} catch (Exception e) {
// when exception occur in finally,this exception will lost, so just print it here
LOGGER.error("exception occur", e);
throw e;
} finally {
connectionProxy.setAutoCommit(true);
}
return result;
}
So the lock will be query multiple times at same time. |
Ⅰ. Issue Description
I am using @GlobalLock to execute my sql , but get a response with
Response[RuntimeException[null]]
from seata.Ⅱ. Describe what happened
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅴ. Anything else we need to know?
Serata config
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: