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

[EJBCLIENT-170] Do not propagate transactions for async methods unless forced to #164

Merged
merged 1 commit into from
Oct 31, 2016

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented Oct 27, 2016

The policy is:

  • If there is a ClientTransaction annotation on the method, use the specified mode, otherwise:
  • If the method is asynchronous (returns Future or is tagged with the ClientAsynchronous annotation), use NOT_SUPPORTED, otherwise:
  • If the method's enclosing class has a ClientTransaction annotation, use the specified mode, otherwise:
  • Use the default mode (SUPPORTS).

…s forced to

The policy is:

* If there is a ClientTransaction annotation on the method, use the specified mode, otherwise:
* If the method is asynchronous (returns Future or is tagged with the ClientAsynchronous annotation), use NOT_SUPPORTED, otherwise:
* If the method's enclosing class has a ClientTransaction annotation, use the specified mode, otherwise:
* Use the default mode (SUPPORTS).
@dmlloyd
Copy link
Member Author

dmlloyd commented Oct 27, 2016

A key weakness of this approach is that it does not account for one-way (void-returning) asynchronous methods. Those will generally be handled on the server anyway. But we don't have a way on the server to force inflow of a transaction, nor do we want one for void methods: we can never know when the method completes, therefore we can never know when it's safe to complete the transaction.

I'm thinking that the server policy will be to always ignore the transaction for void async, if it comes in, and the client would know this happened because of the proceed-async message. For Future-returning async methods, if the transaction is present (and the client is new), the server should inflow it (because it means the user must have specifically opted in to it). If the client is old, then the server probably should ignore it in the same way as done for void-returning methods.

@dmlloyd dmlloyd merged commit 735e557 into wildfly:master Oct 31, 2016
@dmlloyd dmlloyd deleted the ejbclient-170 branch October 31, 2016 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant