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

Clarify the behavior of InstanceHandle.close() #33665

Closed
Ladicek opened this issue May 29, 2023 · 7 comments · Fixed by #43623
Closed

Clarify the behavior of InstanceHandle.close() #33665

Ladicek opened this issue May 29, 2023 · 7 comments · Fixed by #43623
Assignees
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request
Milestone

Comments

@Ladicek
Copy link
Contributor

Ladicek commented May 29, 2023

Description

The CDI specification currently says that Instance.Handle.close() unconditionally calls destroy(). This behavior is inherited from Weld.

ArC's InstanceHandle.close() only calls destroy() if the bean pointed to by the handle is @Dependent, leaving lifecycle management of other beans to the respective context.

In #33523, we made InstanceHandle.close() behavior dependent on the container running mode: by default, it follows the previous ArC behavior, but in the strict mode, it follows the specified behavior. This is confusing and needs to be clarified.

Implementation ideas

One option is to propose a change to the specification.

@Ladicek Ladicek added the kind/enhancement New feature or request label May 29, 2023
@Ladicek Ladicek added area/arc Issue related to ARC (dependency injection) and removed triage/needs-triage labels May 29, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented May 29, 2023

/cc @manovotn (arc), @mkouba (arc)

@mkouba
Copy link
Contributor

mkouba commented Dec 14, 2023

@manovotn Do you happen to know if this was discussed in a spec issue?

@manovotn
Copy link
Contributor

@manovotn Do you happen to know if this was discussed in a spec issue?

No, I don't think this was proposed on the spec level at all.

@mkouba
Copy link
Contributor

mkouba commented Oct 1, 2024

This is confusing and needs to be clarified.

@Ladicek Clarified where? In the spec or in Quarkus docs?

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 1, 2024

My personal opinion is that we shouldn't have added Instance.Handle.close() to the CDI API, but alas, I didn't notice the difference back then and now it's too late :-/ I honestly don't know what we can do with this.

@mkouba
Copy link
Contributor

mkouba commented Oct 1, 2024

My personal opinion is that we shouldn't have added Instance.Handle.close() to the CDI API, but alas, I didn't notice the difference back then and now it's too late :-/ I honestly don't know what we can do with this.

I propose to add a note to the list of Non-standard Features and mark this issue as resolved.

@Ladicek
Copy link
Contributor Author

Ladicek commented Oct 1, 2024

I guess that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants