[ 
https://issues.apache.org/jira/browse/WICKET-5261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697893#comment-13697893
 ] 

Igor Vaynberg commented on WICKET-5261:
---------------------------------------

i resolved this because i consider this issue invalid.

> Any CDI container handle these passivations. So wicket-cdi should handle this 
> too.

wicket-cdi is not a container, it is an integration with one. so, if the 
container handles it it should already work for you.

> Any CDI container handle these passivations.

incorrect. like ive mentioned before, passivating scopes require that all beans 
inside them be serializable. @Depedent is not a passivating scope.

you are declaring the injection point as *transient*, so you have to deal with 
serialization.

@Dependent beans are generally used in use cases where "instance" matters, 
after all, if it didnt the bean could live in a higher scope - this is why they 
are injected without a proxy. what you are doing by re-injecting on 
de-serialization is creating a new instance of the @Dependent object - not 
preserving the state of the previous instance - which to me and most devs would 
be a very surprising behavior because @Dependent lifecycle should be tied to 
the page. the solution you implemented works more like @RequestScoped in the 
sense that at every request you get a new instance.

you are welcome to describe your use case on the @dev in more detail, this is 
not the right place.
                
> After deserialize of a page CDI injection should take place
> -----------------------------------------------------------
>
>                 Key: WICKET-5261
>                 URL: https://issues.apache.org/jira/browse/WICKET-5261
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-cdi
>    Affects Versions: 6.8.0, 6.9.0
>            Reporter: Daniel Zwicker
>            Assignee: Igor Vaynberg
>
> If a page or behavior or what ever has some fields which are injected by cdi 
> and these object are not Serializable so they are market as transient they 
> will be null after deserialization. This is ok. But now the CDI injection 
> should be kicked in an inject new object.
> BTW the injection should take place every time a new request is processed. If 
> the injection occurs e.g before every rendering this bug should be obsolete. 
> I will fill a bug for this 'request handled injection' too. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to