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

ASF subversion and git services commented on OPENJPA-3089:
----------------------------------------------------------

Commit 2ec4aa4a48eb91da0d821011bc0f94aba7d33bbd in openjpa's branch 
refs/heads/OPENJPA-3089 from Paulo Cristovão de Araújo Silva Filho
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=2ec4aa4a4 ]

[OPENJPA-3089] Adding CDI injection to entity listeners

* Aligned openjpa-features to Jakarta EE 11 versions, as JPA 3.2 is aligned to 
it
* Added jakarta.enterprise.cdi-api as provided dependency
* Added InjectionManager and two implementations to allow injection
* Migrated entitylistener instantiation from BeanLifecyleCallbacks to 
InjectionManager

This impl creates and destroys the CDI injected entity listeners when called 
and will be superseeded by a cached implementation, as does the reference impl 
of the spec.


> Add context interception on entity listeners when running in CDI environments
> -----------------------------------------------------------------------------
>
>                 Key: OPENJPA-3089
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3089
>             Project: OpenJPA
>          Issue Type: Improvement
>    Affects Versions: 4.2.0
>            Reporter: Paulo Cristovão de Araújo Silva Filho
>            Assignee: Paulo Cristovão de Araújo Silva Filho
>            Priority: Major
>             Fix For: 4.3.0
>
>
> According to Jakarta Persistence API 3.2 item 
> [3.6.1|https://jakarta.ee/specifications/persistence/3.2/jakarta-persistence-spec-3.2.html#entity-listeners],
>  the persistence provider should, in Jakarta EE environments:
> a) in Jakarta EE environments:
> a.1) use CDI SPI to create instances of the entity listener class;
> a.2) perform injection upon such instances;
> a.3) invoke their {{PostConstruct}} and {{PreDestroy}} methods, if any; and
> a.4) dispose of the entity listener instances; and
> b) in environments where CDI is not enabled, must not invoke entity listeners 
> that depend upon CDI injection.
> The current behavior of OpenJPA is to call the entity listeners regardless 
> they have injected annotated fields, although without the actual injection, 
> which leads to NPEs.
> I'm working in a patch to add CDI support to OpenJPA.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to