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

Support inheritance of cdi contexts #39

Open
glassfishrobot opened this issue Mar 5, 2016 · 9 comments
Open

Support inheritance of cdi contexts #39

glassfishrobot opened this issue Mar 5, 2016 · 9 comments
Labels
microprofile For compatibility with MicroProfile Priority: Major Type: New Feature

Comments

@glassfishrobot
Copy link

Currently ee concurrency utilities are a nice candidates for reactive pools but not being able to reuse cdi instances kind of make it useless - a simple pool does the same. Being able to say cdi bean instances are inherited would be awesome and would make servlet 3 async feature integrated at ee level in a smooth manner (keep in mind servlet request lifecycle is not cdi one for instance).

Some would say it is dangerous cause not thread safe bit most of these cases are under programmer responsability so it is fine i think

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Reported by rmannibucau

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
reza_rahman said:
Please add clarifying examples to this. I can't understand this text let alone act upon it. Even better is contributing a potential fix that can be pulled in from say GitHub into the spec.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
rmannibucau said:
From a servlet chain you have MyBean injected which is resuest scoped. Then in the servlet your start an AsyncContext and launch a task in a ManagedExecutorService. Then you expect very often to have the same MyBean instance which is not the case since request scope is neither started nor inherited.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
reza_rahman said:
This seems pretty legitimate. I'll test it out and double check the spec but it is good for justification of a new revision of the specification.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
reza_rahman said:
Reading the spec it seems obvious to me this case was expected to work along with things like security, JNDI and EJB context. Therefore I am likely to think this is probably an RI bug including perhaps others. I'll file any requisite bugs in the RI and see if they can be fixed.

I'm unlikely to use this as justification for a revision of the spec. I think the text is already clear enough and would only benefit marginally from further clarification.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
rmannibucau said:
And if the main context is destroyed through cdi api what happens? Both cases are broken if unspecified IMO cause a user could rely on both.

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA CONCURRENCY_EE_SPEC-39

@glassfishrobot
Copy link
Author

@njr-11 njr-11 added the microprofile For compatibility with MicroProfile label Nov 13, 2019
@njr-11
Copy link
Contributor

njr-11 commented Nov 13, 2019

MicroProfile Context Propagation and WELD prototyped some work in this space and was able to get some scenarios working. I would like to see how CDI context propagation works standardized within Jakarta EE, but I think the proper place for that to happen is within the CDI specification, which will be better aware of and better equipped to deal with the intricacies of the different scopes and life cycles, as well as able to levy actual requirements against the CDI implementations to make it possible. Is there any way this issue could be transferred over to CDI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
microprofile For compatibility with MicroProfile Priority: Major Type: New Feature
Projects
None yet
Development

No branches or pull requests

2 participants