CDI-616 Injection point declared as transient is not useful

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

CDI-616 Injection point declared as transient is not useful

Stephan Knitelius
Hi,

I frequently encounter injections marked transient in client projects. I really think it would be of great help if we where to define Error/Warning when injection fields are marked transient. 

As Mark pointed out there may be a valid use cases for non normal-scoped bean injections to be made transient. 

My suggestion is: 
  • ERROR - when normal scoped injects are marked transient.
  • WARNING - when non-normal scoped injects are marked transient.
  
Looking forward to your feedback.

Stephan

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Emily Jiang
If we define an error, we will introduce a backward compatibility issue. Some app will stop starting. Will this cause a big problem? If this is not a concern, +1 on defining a DefinitionError on this case: ERROR - when normal scoped injects are marked transient. and a warning on WARNING - when non-normal scoped injects are marked transient.

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From:        Stephan Knitelius <[hidden email]>
To:        cdi-dev <[hidden email]>,
Date:        19/07/2016 08:26
Subject:        [cdi-dev] CDI-616 Injection point declared as transient is not        useful
Sent by:        [hidden email]




Hi,

I frequently encounter injections marked transient in client projects. I really think it would be of great help if we where to define Error/Warning when injection fields are marked transient. 

As Mark pointed out there may be a valid use cases for non normal-scoped bean injections to be made transient. 

My suggestion is: 
  • ERROR - when normal scoped injects are marked transient.
  • WARNING - when non-normal scoped injects are marked transient.
      
    Looking forward to your feedback.

    Stephan_______________________________________________
    cdi-dev mailing list
    [hidden email]
    https://lists.jboss.org/mailman/listinfo/cdi-dev

    Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
    http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.

    Unless stated otherwise above:
    IBM United Kingdom Limited - Registered in England and Wales with number 741598.
    Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Stephan Knitelius
Yes it will cause start up issues for applications which define transient normal scoped injections, however these Apps currently have runtime issues after dezieralization of passivatable scoped bean.

Trading an easily fixable start-up issue for a hard to reproduce runtime issue seems like a good trade off to me.

Stephan
 




On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]> wrote:
If we define an error, we will introduce a backward compatibility issue. Some app will stop starting. Will this cause a big problem? If this is not a concern, +1 on defining a DefinitionError on this case: ERROR - when normal scoped injects are marked transient. and a warning on WARNING - when non-normal scoped injects are marked transient.

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From:        Stephan Knitelius <[hidden email]>
To:        cdi-dev <[hidden email]>,
Date:        19/07/2016 08:26
Subject:        [cdi-dev] CDI-616 Injection point declared as transient is not        useful
Sent by:        [hidden email]




Hi,

I frequently encounter injections marked transient in client projects. I really think it would be of great help if we where to define Error/Warning when injection fields are marked transient. 

As Mark pointed out there may be a valid use cases for non normal-scoped bean injections to be made transient. 

My suggestion is: 
  • ERROR - when normal scoped injects are marked transient.
  • WARNING - when non-normal scoped injects are marked transient.
      
    Looking forward to your feedback.

  • Stephan_______________________________________________
    cdi-dev mailing list
    [hidden email]
    https://lists.jboss.org/mailman/listinfo/cdi-dev

    Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
    http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.

    Unless stated otherwise above:
    IBM United Kingdom Limited - Registered in England and Wales with number 741598.
    Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Martin Kouba
Do you suggest to log an ERROR message or to treat it as a definition error?

Altough I don't have any real use case, I'm not so sure this should be a
definition error. It reminds me unproxyable types with non-private final
methods (CDI-527) - right now it is a definition error (and I think it's
good) but the EG decided to change this, although it could result in
runtime errors (and both Weld and OWB allow to relax this restriction).

As to WARNING - the spec currently does not define anything like logging
or logging levels. IIRC the only mention is in 10.5. Observer notification:
"If the observer method is a transactional observer method, any
exception is caught and logged by the container."

And I believe we should not introduce logging levels in the spec.

Martin

Dne 19.7.2016 v 12:52 Stephan Knitelius napsal(a):

> Yes it will cause start up issues for applications which define
> transient normal scoped injections, however these Apps currently have
> runtime issues after dezieralization of passivatable scoped bean.
>
> Trading an easily fixable start-up issue for a hard to reproduce runtime
> issue seems like a good trade off to me.
>
> Stephan
>
>
>
>
>
> On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     If we define an error, we will introduce a backward compatibility
>     issue. Some app will stop starting. Will this cause a big problem?
>     If this is not a concern, +1 on defining a DefinitionError on this
>     case: ERROR - when normal scoped injects are marked transient.and a
>     warning on WARNING - when non-normal scoped injects are marked
>     transient.
>
>     Many thanks,
>     Emily
>     ===========================
>     Emily Jiang
>     WebSphere Application Server, CDI Development Lead
>
>     MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
>     Phone:  +44 (0)1962 816278  Internal: 246278
>
>     Email: [hidden email] <mailto:[hidden email]>
>     Lotus Notes: Emily Jiang/UK/IBM@IBMGB
>
>
>
>
>     From:        Stephan Knitelius <[hidden email]
>     <mailto:[hidden email]>>
>     To:        cdi-dev <[hidden email]
>     <mailto:[hidden email]>>,
>     Date:        19/07/2016 08:26
>     Subject:        [cdi-dev] CDI-616 Injection point declared as
>     transient is not        useful
>     Sent by:        [hidden email]
>     <mailto:[hidden email]>
>     ------------------------------------------------------------------------
>
>
>
>     Hi,
>
>     I frequently encounter injections marked transient in client
>     projects. I really think it would be of great help if we where to
>     define Error/Warning when injection fields are marked transient.
>
>     As Mark pointed out there may be a valid use cases for non
>     normal-scoped bean injections to be made transient.
>
>     My suggestion is:
>
>       * ERROR - when normal scoped injects are marked transient.
>
>       *
>       * WARNING - when non-normal scoped injects are marked transient.
>
>         Looking forward to your feedback.
>
>       *
>       * Stephan_______________________________________________
>         cdi-dev mailing list
>         [hidden email] <mailto:[hidden email]>
>         https://lists.jboss.org/mailman/listinfo/cdi-dev
>
>         Note that for all code provided on this list, the provider
>         licenses the code under the Apache License, Version 2
>         (http://www.apache.org/licenses/LICENSE-2.0.html). For all other
>         ideas provided on this list, the provider waives all patent and
>         other intellectual property rights inherent in such information.
>
>         Unless stated otherwise above:
>         IBM United Kingdom Limited - Registered in England and Wales
>         with number 741598.
>         Registered office: PO Box 41, North Harbour, Portsmouth,
>         Hampshire PO6 3AU
>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Emily Jiang
I prefer to classify a definition error if when normal scoped injects are marked transient as I agree logging an error or warning are implementation details.

I am still struggling to find user case for "non-normal scoped injects are marked transient".

If it is not useful and problematic, why don't we just declare a Definition Error if an injection field defined transient? Easy and straightforward. Thoughts?

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From:        Martin Kouba <[hidden email]>
To:        [hidden email],
Date:        20/07/2016 15:38
Subject:        Re: [cdi-dev] CDI-616 Injection point declared as transient is not useful
Sent by:        [hidden email]




Do you suggest to log an ERROR message or to treat it as a definition error?

Altough I don't have any real use case, I'm not so sure this should be a
definition error. It reminds me unproxyable types with non-private final
methods (CDI-527) - right now it is a definition error (and I think it's
good) but the EG decided to change this, although it could result in
runtime errors (and both Weld and OWB allow to relax this restriction).

As to WARNING - the spec currently does not define anything like logging
or logging levels. IIRC the only mention is in 10.5. Observer notification:
"If the observer method is a transactional observer method, any
exception is caught and logged by the container."

And I believe we should not introduce logging levels in the spec.

Martin

Dne 19.7.2016 v 12:52 Stephan Knitelius napsal(a):
> Yes it will cause start up issues for applications which define
> transient normal scoped injections, however these Apps currently have
> runtime issues after dezieralization of passivatable scoped bean.
>
> Trading an easily fixable start-up issue for a hard to reproduce runtime
> issue seems like a good trade off to me.
>
> Stephan
>
>
>
>
>
> On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]
> <
mailto:EMIJIANG@...>> wrote:
>
>     If we define an error, we will introduce a backward compatibility
>     issue. Some app will stop starting. Will this cause a big problem?
>     If this is not a concern, +1 on defining a DefinitionError on this
>     case: ERROR - when normal scoped injects are marked transient.and a
>     warning on WARNING - when non-normal scoped injects are marked
>     transient.
>
>     Many thanks,
>     Emily
>     ===========================
>     Emily Jiang
>     WebSphere Application Server, CDI Development Lead
>
>     MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
>     Phone:  +44 (0)1962 816278  Internal: 246278
>
>     Email: [hidden email] <
mailto:emijiang@...>
>     Lotus Notes: Emily Jiang/UK/IBM@IBMGB
>
>
>
>
>     From:        Stephan Knitelius <[hidden email]
>     <
mailto:stephan@...>>
>     To:        cdi-dev <[hidden email]
>     <
[hidden email]>>,
>     Date:        19/07/2016 08:26
>     Subject:        [cdi-dev] CDI-616 Injection point declared as
>     transient is not        useful
>     Sent by:        [hidden email]
>     <
[hidden email]>
>     ------------------------------------------------------------------------
>
>
>
>     Hi,
>
>     I frequently encounter injections marked transient in client
>     projects. I really think it would be of great help if we where to
>     define Error/Warning when injection fields are marked transient.
>
>     As Mark pointed out there may be a valid use cases for non
>     normal-scoped bean injections to be made transient.
>
>     My suggestion is:
>
>       * ERROR - when normal scoped injects are marked transient.
>
>       *
>       * WARNING - when non-normal scoped injects are marked transient.
>
>         Looking forward to your feedback.
>
>       *
>       * Stephan_______________________________________________
>         cdi-dev mailing list
>         [hidden email] <
[hidden email]>
>        
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
>         Note that for all code provided on this list, the provider
>         licenses the code under the Apache License, Version 2
>         (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other
>         ideas provided on this list, the provider waives all patent and
>         other intellectual property rights inherent in such information.
>
>         Unless stated otherwise above:
>         IBM United Kingdom Limited - Registered in England and Wales
>         with number 741598.
>         Registered office: PO Box 41, North Harbour, Portsmouth,
>         Hampshire PO6 3AU
>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
>
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Tomas Remes

As you said. If we introduce definition error for this it won't be backward compatible so warning could be sufficient I think and therefore (maybe) I wouldn't solve this at specification level but only at implementation level. That's my current feeling.

Tom

----- Original Message -----
From: "Emily Jiang" <[hidden email]>
To: "Martin Kouba" <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, July 20, 2016 5:43:59 PM
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not useful

I prefer to classify a definition error if when normal scoped injects are marked transient as I agree logging an error or warning are implementation details.

I am still struggling to find user case for "non-normal scoped injects are marked transient".

If it is not useful and problematic, why don't we just declare a Definition Error if an injection field defined transient? Easy and straightforward. Thoughts?

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone: +44 (0)1962 816278 Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From: Martin Kouba <[hidden email]>
To: [hidden email],
Date: 20/07/2016 15:38
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not useful
Sent by: [hidden email]




Do you suggest to log an ERROR message or to treat it as a definition error?

Altough I don't have any real use case, I'm not so sure this should be a
definition error. It reminds me unproxyable types with non-private final
methods (CDI-527) - right now it is a definition error (and I think it's
good) but the EG decided to change this, although it could result in
runtime errors (and both Weld and OWB allow to relax this restriction).

As to WARNING - the spec currently does not define anything like logging
or logging levels. IIRC the only mention is in 10.5. Observer notification:
"If the observer method is a transactional observer method, any
exception is caught and logged by the container."

And I believe we should not introduce logging levels in the spec.

Martin

Dne 19.7.2016 v 12:52 Stephan Knitelius napsal(a):

> Yes it will cause start up issues for applications which define
> transient normal scoped injections, however these Apps currently have
> runtime issues after dezieralization of passivatable scoped bean.
>
> Trading an easily fixable start-up issue for a hard to reproduce runtime
> issue seems like a good trade off to me.
>
> Stephan
>
>
>
>
>
> On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]
> < mailto:[hidden email] >> wrote:
>
> If we define an error, we will introduce a backward compatibility
> issue. Some app will stop starting. Will this cause a big problem?
> If this is not a concern, +1 on defining a DefinitionError on this
> case: ERROR - when normal scoped injects are marked transient.and a
> warning on WARNING - when non-normal scoped injects are marked
> transient.
>
> Many thanks,
> Emily
> ===========================
> Emily Jiang
> WebSphere Application Server, CDI Development Lead
>
> MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
> Phone: +44 (0)1962 816278 Internal: 246278
>
> Email: [hidden email] < mailto:[hidden email] >
> Lotus Notes: Emily Jiang/UK/IBM@IBMGB
>
>
>
>
> From: Stephan Knitelius <[hidden email]
> < mailto:[hidden email] >>
> To: cdi-dev <[hidden email]
> < mailto:[hidden email] >>,
> Date: 19/07/2016 08:26
> Subject: [cdi-dev] CDI-616 Injection point declared as
> transient is not useful
> Sent by: [hidden email]
> < mailto:[hidden email] >
> ------------------------------------------------------------------------
>
>
>
> Hi,
>
> I frequently encounter injections marked transient in client
> projects. I really think it would be of great help if we where to
> define Error/Warning when injection fields are marked transient.
>
> As Mark pointed out there may be a valid use cases for non
> normal-scoped bean injections to be made transient.
>
> My suggestion is:
>
> * ERROR - when normal scoped injects are marked transient.
>
> *
> * WARNING - when non-normal scoped injects are marked transient.
>
> Looking forward to your feedback.
>
> *
> * Stephan_______________________________________________
> cdi-dev mailing list
> [hidden email] < mailto:[hidden email] >
> https://lists.jboss.org/mailman/listinfo/cdi-dev 
>
> Note that for all code provided on this list, the provider
> licenses the code under the Apache License, Version 2
> ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other
> ideas provided on this list, the provider waives all patent and
> other intellectual property rights inherent in such information.
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales
> with number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth,
> Hampshire PO6 3AU
>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev 
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev 

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Emily Jiang
As Stephen points out if the "when normal scoped injects are marked transient", it will fail at runtime anyway. I am kind of thinking to throw a definition error when injection field marks as transient.

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From:        Tomas Remes <[hidden email]>
To:        Emily Jiang/UK/IBM@IBMGB,
Cc:        [hidden email]
Date:        21/07/2016 07:13
Subject:        Re: [cdi-dev] CDI-616 Injection point declared as transient is        not        useful
Sent by:        [hidden email]





As you said. If we introduce definition error for this it won't be backward compatible so warning could be sufficient I think and therefore (maybe) I wouldn't solve this at specification level but only at implementation level. That's my current feeling.

Tom

----- Original Message -----
From: "Emily Jiang" <[hidden email]>
To: "Martin Kouba" <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, July 20, 2016 5:43:59 PM
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not                 useful

I prefer to classify a definition error if when normal scoped injects are marked transient as I agree logging an error or warning are implementation details.

I am still struggling to find user case for "non-normal scoped injects are marked transient".

If it is not useful and problematic, why don't we just declare a Definition Error if an injection field defined transient? Easy and straightforward. Thoughts?

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone: +44 (0)1962 816278 Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From: Martin Kouba <[hidden email]>
To: [hidden email],
Date: 20/07/2016 15:38
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not useful
Sent by: [hidden email]




Do you suggest to log an ERROR message or to treat it as a definition error?

Altough I don't have any real use case, I'm not so sure this should be a
definition error. It reminds me unproxyable types with non-private final
methods (CDI-527) - right now it is a definition error (and I think it's
good) but the EG decided to change this, although it could result in
runtime errors (and both Weld and OWB allow to relax this restriction).

As to WARNING - the spec currently does not define anything like logging
or logging levels. IIRC the only mention is in 10.5. Observer notification:
"If the observer method is a transactional observer method, any
exception is caught and logged by the container."

And I believe we should not introduce logging levels in the spec.

Martin

Dne 19.7.2016 v 12:52 Stephan Knitelius napsal(a):
> Yes it will cause start up issues for applications which define
> transient normal scoped injections, however these Apps currently have
> runtime issues after dezieralization of passivatable scoped bean.
>
> Trading an easily fixable start-up issue for a hard to reproduce runtime
> issue seems like a good trade off to me.
>
> Stephan
>
>
>
>
>
> On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]
> <
mailto:EMIJIANG@... >> wrote:
>
> If we define an error, we will introduce a backward compatibility
> issue. Some app will stop starting. Will this cause a big problem?
> If this is not a concern, +1 on defining a DefinitionError on this
> case: ERROR - when normal scoped injects are marked transient.and a
> warning on WARNING - when non-normal scoped injects are marked
> transient.
>
> Many thanks,
> Emily
> ===========================
> Emily Jiang
> WebSphere Application Server, CDI Development Lead
>
> MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
> Phone: +44 (0)1962 816278 Internal: 246278
>
> Email: [hidden email] <
mailto:emijiang@... >
> Lotus Notes: Emily Jiang/UK/IBM@IBMGB
>
>
>
>
> From: Stephan Knitelius <[hidden email]
> <
mailto:stephan@... >>
> To: cdi-dev <[hidden email]
> <
[hidden email] >>,
> Date: 19/07/2016 08:26
> Subject: [cdi-dev] CDI-616 Injection point declared as
> transient is not useful
> Sent by: [hidden email]
> <
[hidden email] >
> ------------------------------------------------------------------------
>
>
>
> Hi,
>
> I frequently encounter injections marked transient in client
> projects. I really think it would be of great help if we where to
> define Error/Warning when injection fields are marked transient.
>
> As Mark pointed out there may be a valid use cases for non
> normal-scoped bean injections to be made transient.
>
> My suggestion is:
>
> * ERROR - when normal scoped injects are marked transient.
>
> *
> * WARNING - when non-normal scoped injects are marked transient.
>
> Looking forward to your feedback.
>
> *
> * Stephan_______________________________________________
> cdi-dev mailing list
> [hidden email] <
[hidden email] >
>
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider
> licenses the code under the Apache License, Version 2
> (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other
> ideas provided on this list, the provider waives all patent and
> other intellectual property rights inherent in such information.
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales
> with number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth,
> Hampshire PO6 3AU
>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
>
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Reply | Threaded
Open this post in threaded view
|

Re: CDI-616 Injection point declared as transient is not useful

Stephan Knitelius
+1 on the definition error Emily suggests. Especially since transient will cause exceptions random hard to reproduce exceptions at runtime. 

Unproxiable Type due to non private final methods and the like will be encountered as soon as some tries to use it during development. In so far its different, since the transient will only cause a problem when passivatable scopes are deserialized, which is unlikely during development and even if it occurs it will be probably be considered as development glitch. 

Also in my experience implementation specific warnings and the like cause more confusions then anything else. Also in the context in of the application server the console warnings will be lost in the flood of startup outputs.

On Thu, 21 Jul 2016 at 11:12 Emily Jiang <[hidden email]> wrote:
As Stephen points out if the "when normal scoped injects are marked transient", it will fail at runtime anyway. I am kind of thinking to throw a definition error when injection field marks as transient.

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From:        Tomas Remes <[hidden email]>
To:        Emily Jiang/UK/IBM@IBMGB,
Cc:        [hidden email]
Date:        21/07/2016 07:13
Subject:        Re: [cdi-dev] CDI-616 Injection point declared as transient is        not        useful
Sent by:        [hidden email]




As you said. If we introduce definition error for this it won't be backward compatible so warning could be sufficient I think and therefore (maybe) I wouldn't solve this at specification level but only at implementation level. That's my current feeling.

Tom

----- Original Message -----
From: "Emily Jiang" <[hidden email]>
To: "Martin Kouba" <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, July 20, 2016 5:43:59 PM
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not                 useful

I prefer to classify a definition error if when normal scoped injects are marked transient as I agree logging an error or warning are implementation details.

I am still struggling to find user case for "non-normal scoped injects are marked transient".

If it is not useful and problematic, why don't we just declare a Definition Error if an injection field defined transient? Easy and straightforward. Thoughts?

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead

MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone: +44 (0)1962 816278 Internal: 246278

Email: [hidden email]
Lotus Notes: Emily Jiang/UK/IBM@IBMGB




From: Martin Kouba <[hidden email]>
To: [hidden email],
Date: 20/07/2016 15:38
Subject: Re: [cdi-dev] CDI-616 Injection point declared as transient is not useful
Sent by: [hidden email]




Do you suggest to log an ERROR message or to treat it as a definition error?

Altough I don't have any real use case, I'm not so sure this should be a
definition error. It reminds me unproxyable types with non-private final
methods (CDI-527) - right now it is a definition error (and I think it's
good) but the EG decided to change this, although it could result in
runtime errors (and both Weld and OWB allow to relax this restriction).

As to WARNING - the spec currently does not define anything like logging
or logging levels. IIRC the only mention is in 10.5. Observer notification:
"If the observer method is a transactional observer method, any
exception is caught and logged by the container."

And I believe we should not introduce logging levels in the spec.

Martin

Dne 19.7.2016 v 12:52 Stephan Knitelius napsal(a):
> Yes it will cause start up issues for applications which define
> transient normal scoped injections, however these Apps currently have
> runtime issues after dezieralization of passivatable scoped bean.
>
> Trading an easily fixable start-up issue for a hard to reproduce runtime
> issue seems like a good trade off to me.
>
> Stephan
>
>
>
>
>
> On Tue, 19 Jul 2016 at 12:12 Emily Jiang <[hidden email]
> <
[hidden email] >> wrote:
>
> If we define an error, we will introduce a backward compatibility
> issue. Some app will stop starting. Will this cause a big problem?
> If this is not a concern, +1 on defining a DefinitionError on this
> case: ERROR - when normal scoped injects are marked transient.and a
> warning on WARNING - when non-normal scoped injects are marked
> transient.
>
> Many thanks,
> Emily
> ===========================
> Emily Jiang
> WebSphere Application Server, CDI Development Lead
>
> MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
> Phone: +44 (0)1962 816278 Internal: 246278
>
> Email: [hidden email] <
[hidden email] >
> Lotus Notes: Emily Jiang/UK/IBM@IBMGB
>
>
>
>
> From: Stephan Knitelius <[hidden email]
> <
[hidden email] >>
> To: cdi-dev <[hidden email]
> <
[hidden email] >>,
> Date: 19/07/2016 08:26
> Subject: [cdi-dev] CDI-616 Injection point declared as
> transient is not useful
> Sent by: [hidden email]
> <
[hidden email] >
> ------------------------------------------------------------------------
>
>
>
> Hi,
>
> I frequently encounter injections marked transient in client
> projects. I really think it would be of great help if we where to
> define Error/Warning when injection fields are marked transient.
>
> As Mark pointed out there may be a valid use cases for non
> normal-scoped bean injections to be made transient.
>
> My suggestion is:
>
> * ERROR - when normal scoped injects are marked transient.
>
> *
> * WARNING - when non-normal scoped injects are marked transient.
>
> Looking forward to your feedback.
>
> *
> * Stephan_______________________________________________
> cdi-dev mailing list
> [hidden email] <
[hidden email] >
>
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider
> licenses the code under the Apache License, Version 2
> (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other
> ideas provided on this list, the provider waives all patent and
> other intellectual property rights inherent in such information.
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales
> with number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth,
> Hampshire PO6 3AU
>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
>
https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
>

--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.