Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-21270

Ensure that Persistence Unit bytecode transformers are only added for each deployment/subdeployment that need them

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • JPA / Hibernate
    • ---
    • ---

      Consider how to update the WildFly EE/Persistence Container for performing bytecode enhancement of entities in the most efficient way.

      Jakarta EE 12 will include Persistence 4.0 which moves some of the bytecode enhancement requirements from the Persistence Provider to the EE container. The Persistence Provider will still perform the actual bytecode enhancement but the EE/Persistence container will drive it.

      For this issue, when WildFly has internally constructed the PersistenceUnitInfo we should be able to find all Entity classes in the deployment and configure the needed classloader transformers to perform the enhancement. Then, we can load the entity classes.

      Before actually trying ^, we should stop and review if/when we can actually load the entity classes which means we also need to ensure we don't break application datasources. Still, this likely would be the most optimal way to enhance entity classes without wasting cycles due to multiple threads trying to do the enhancement at the same time.

      If we don't want to load the entity classes directly then we will see some inefficiency during deployment or runtime depending on when the entity classes are loaded. In the case that we settle with some inefficiency, we can consider other optimizations that would be less efficient but still better.

              smarlow1@redhat.com Scott Marlow
              smarlow1@redhat.com Scott Marlow
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: