-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update handling of persistence units for Jakarta Persistence 3.2 #25198
Comments
In looking at the glassfish codebase, the PersistenceContext injection is handled by the com.sun.enterprise.deployment.annotation.handlers.EntityManagerReferenceHandler class, as well as org.glassfish.weld.services.InjectionServicesImpl. I don't see any easy way to add an alias from an annotation to the PersistenceContext annotation. Maybe an annotation processor could be used to bootstrap the initial ratifying release. It would rewrite the custom qualifier annotation from the persistence.xml to the correct PersistenceContext with the same persistence-unit the qualifier was specified in. Alternatively, it would seem a synthetic bean for EntityManagerReferenceHandler that replaces the @AnnotationHandlerFor(PersistenceContext.class) type with a @AnnotationHandlerFor(qualifier.class) could be used. Any other thoughts on where to add this processing? |
Not sure if this is related to eclipse-ee4j/eclipselink#2207 |
Yes, @hantsy, this issue replaces eclipse-ee4j/eclipselink#2207. It’s really a responsibility of GlassFish as Jakarta EE container, to provide the producer. EclipseLink just provides the info about the qualifier class that matches the persistence unit. |
Environment Details
Problem Description
Jakarta Persistence 3.2 has added qualifier and scope annotations for supporting injection of an EntityManager. The current glassfish 8.x branches still only support the Jakarta Persistence persistence_3_0.xsd schema.
Steps to reproduce
This draft PR on the platform-tck has an example of injecting an EntityManager using a custom qualifier specified in the deployment persistence.xml:
jakartaee/platform-tck#1623
Running that test fails because the injection site is not recognized as equivalent to one with the commented out
@PersistenceUnit(unitName = "CTS-EM")
annotation.The current deployment failure is:
Impact of Issue
Glassfish will not be able to pass the EE 11 platform tck until this is resolved.
The text was updated successfully, but these errors were encountered: