Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WFTC-54] forbid to enlist XAResource to a timeouted transaction #63

Merged

Conversation

ochaloup
Copy link
Contributor

@ochaloup ochaloup commented Jan 2, 2019

https://issues.jboss.org/browse/WFTC-54

if XAResource is to be enlisted to a transaction that already timeouted then rather throw an exception than continue with the enlistment (see https://issues.jboss.org/browse/WFTC-54?focusedCommentId=13677791#comment-13677791)

This changes the behaviour as the previously the enlistment was permitted and the timeout was changed to value 1 second despite the transaction already timed out.

Copy link
Member

@dmlloyd dmlloyd left a comment

Choose a reason for hiding this comment

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

Otherwise looks OK.

@@ -160,7 +158,8 @@ public int getTransactionTimeout() {

public boolean enlistResource(final XAResource xaRes) throws RollbackException, IllegalStateException, SystemException {
Assert.checkNotNullParam("xaRes", xaRes);
final int estimatedRemainingTime = max(1, getEstimatedRemainingTime());
final int estimatedRemainingTime = getEstimatedRemainingTime();
if(estimatedRemainingTime == 0) throw Log.log.cannotEnlistToTimeoutedTransaction(xaRes, this);
Copy link
Member

Choose a reason for hiding this comment

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

TimedOut rather than Timeouted.

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. thanks!

@ochaloup ochaloup force-pushed the WFTC-54-timeouted-txn-throws-exception branch from 42c0435 to 0712f8c Compare January 2, 2019 22:49
@dmlloyd dmlloyd merged commit dd11e52 into wildfly:master Jan 2, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants