Issues
- Make TypedParameterValue a recordHHH-19340Gavin King
- Better leverage for-update-of to help minimize situations where follow-on is neededHHH-19339
- Improve performance of follow-on lockingHHH-19338
- Only perform follow-on locking when *explicitly* asked toHHH-19337
- Proper implementation for JPA extended locking scopeHHH-19336
- Redesign follow-on lockingHHH-19335
- CCE arising from tuple passed to HQL position() functionHHH-19334Gavin King
- Calling flush before query execution may cause PropertyValueException: Detached entity with generated idHHH-19333
- Figure out BulkManipulationTest issues with CockroachDBHHH-19332Karel Maesen
- query plan caching generates incorrect SQL, not taking parameters type into accountHHH-19331
- Error in lockstring generation in PostgreSQLHHH-19330Resolved issue: HHH-19330Jan Schatteman
- AssertionError visiting roots in query joinsHHH-19329
- @NaturalIdClassHHH-19328Gavin King
- overload SF.addNamedQuery() to take TypedQuery and return TypedQueryReferenceHHH-19327Resolved issue: HHH-19327Gavin King
- Jakarta Data CrudRepository is generated without Types in UpdateAll, InsertAll and SaveAll MethodsHHH-19326
- Upgrade to Jandex 3.3.0HHH-19325Resolved issue: HHH-19325Steve Ebersole
- Switch tests using hbm.xml to use mapping.xmlHHH-19324
- Add a CI job in the Hibernate ORM project for Hibernate ReactiveHHH-19323
- Batched unidirectional one-to-many update failingHHH-19322
- Improve inline documentation for @SuppressWarnings in registerStoredProcedureParameter, getResultList, and unwrap methodsHHH-19321Resolved issue: HHH-19321
- Assigned id value is not passed into BeforeExecutionGenerator#generate() method when allowAssignedIdentifiers() is true and id has been assignedHHH-19320Resolved issue: HHH-19320Marco Belladelli
- StatelessSession.findMultiple() accepting a LockModeHHH-19319Resolved issue: HHH-19319Gavin King
- follow-on locking and StatelessSessionHHH-19318Resolved issue: HHH-19318Gavin King
- Mark org.hibernate.boot.models as incubatingHHH-19317Steve Ebersole
- subselect fetching defined in maping.xml not honoredHHH-19316
- SINGLE_TABLE inheritance makes treat() pick wrong columns when multiple subclasses have a field with the same nameHHH-19315
- StackOverflowException when using onConflict with createCriteriaInsertValues and createCriteriaInsertSelectHHH-19314Andrea Boriero
- EntityGraph and OneToOne relationship is loading twice as many queriesHHH-19313
- BytecodeProviderImpl throwing java.lang.IndexOutOfBoundsExceptionHHH-19312
- NPE with Query Cache, Left Join Fetch, Inheritance on Both Sides, and No AssociationHHH-19311
- Simplified declaration of type for basic mappings in XMLHHH-19310
- Switch to Central Publishing Portal API for publishing to Maven CentralHHH-19309Marko Bekhta
- lock timeoutsHHH-19308
- NPE when entity class missing from persistence.xml is id of another entityHHH-19307Jan Schatteman
- Composite generator may not respect the event types of generators it consits ofHHH-19306Resolved issue: HHH-19306Marko Bekhta
- NPE in EntityEntryContext nonEnhancedEntityXref.get( entity )HHH-19305
- NPE in ResultSetMappingProcessor when using createNativeQuery with {x.*} notation and Entity with Embeddable that contains relational mappingsHHH-19304
- validate @Id fields against @IdClass in ProcessorHHH-19303Resolved issue: HHH-19303Gavin King
- composite ids with no id classHHH-19302
- Must import FQCN when generating metamodel class for inner Jakarta Data repository interfaceHHH-19301Resolved issue: HHH-19301Čedomir Igaly
- more ConstraintKindsHHH-19300Resolved issue: HHH-19300Gavin King
- <element-collection/> with LIST classification interpreted as BAGHHH-19299
- add convenience overloads of StatelessSession.get() which default GraphSemantic.LOADHHH-19298Resolved issue: HHH-19298Gavin King
- Register json functions in SingleStore community dialectHHH-19297Oleksandr Yeliseiev
- overload createSelectionQuery() to accept an EntityGraph instead of a result classHHH-19296Resolved issue: HHH-19296Gavin King
- Foreign keys are dropped when using schema = "public" after migrating to Spring Boot 3HHH-19295
- NodeBuilder collection*() doesn't work with enum collectionsHHH-19294
- Criteria isMember() doesn't work with collections mapped as arrayHHH-19293Resolved issue: HHH-19293
- Significant Memory Increase After Upgrading from Spring Boot 3.3.5 to 3.4.4HHH-19292
- Expressions.nullExpresion() in querydsl result in NPE in SqmExpressible with named parametersHHH-19291Resolved issue: HHH-19291Andrea Boriero
Add filtration by package name for enhancer
Description
Details
Assignee
UnassignedUnassignedReporter
Oleksii MiroshnykOleksii MiroshnykComponents
Priority
Major
Details
Details
Assignee
Reporter
Components
Priority
Activity
Marc MarcOctober 1, 2023 at 12:37 PMEdited
Please - when using the enhancement plugin and doing it statically this creates so many problems when booting up -
It is done statically to avoid module errors that cannot be resolved as one never wants to alter the hibernate core module-info if they are going modular
Caused by: org.hibernate.HibernateException: HHH000488: Bytecode enhancement failed for class: com.guicedee.activitymaster.fsdm.db.entities.arrangement.ArrangementXClassification. It might be due to the Java module system preventing Hibernate ORM from defining an enhanced class in the same package as class com.guicedee.activitymaster.fsdm.db.entities.arrangement.ArrangementXClassification. In this case, the class should be opened and exported to Hibernate ORM.
at org.hibernate.orm.core@6.2.9.Final/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.resolveClassLoadingStrategy(ByteBuddyState.java:437)
at org.hibernate.orm.core@6.2.9.Final/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$1.run(ByteBuddyState.java:207)
at org.hibernate.orm.core@6.2.9.Final/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState$1.run(ByteBuddyState.java:201)
at org.hibernate.orm.core@6.2.9.Final/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.lambda$load$0(ByteBuddyState.java:214)
at net.bytebuddy@1.14.7/net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
... 73 more
Caused by: java.lang.IllegalAccessException: module org.hibernate.orm.core does not read module com.guicedee.activitymaster.fsdm
at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:282)
at org.hibernate.orm.core@6.2.9.Final/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.resolveClassLoadingStrategy(ByteBuddyState.java:434)
... 77 more
Obviously opening up the module does not resolve the strict encapsulation that hibernate.core does not read from my devloped module xD
From 6.2 it seems that bytecode/proxy does not detect if the classes have been statically enhanced, and then tries to enhance them again. The location specified can be overridden with persistence.xml properties, however this error stills shows as bytebuddy is still trying to enhance a module that is statically enhanced, and the module hibernate.core cannot be set to read child modules
I think 6.2 and up needs to have the detection of statically enhanced classes fixed
Seems in hibernate 6.2 bytecode enhancement is enabled by default
in org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl#EntityManagerFactoryBuilderImpl
propertyValue = configurationValues.remove( AvailableSettings.ENHANCER_ENABLE_LAZY_INITIALIZATION ); if ( propertyValue != null ) { lazyInitializationEnabled = Boolean.parseBoolean( propertyValue.toString() ); } else { lazyInitializationEnabled = true; }
and the it does
if ( dirtyTrackingEnabled || lazyInitializationEnabled || associationManagementEnabled ) { EnhancementContext enhancementContext = getEnhancementContext( dirtyTrackingEnabled, lazyInitializationEnabled, associationManagementEnabled ); persistenceUnit.pushClassTransformer( enhancementContext ); }
Probably it does some some good job, but it also starts to produce unexpected exceptions about classes that you don’t use or even know. For example I’m facing some exception OAuth2 security classes from spring while I’m not using spring outh2 security but it has some imports to something else that is actually a root cause.
It is because there is no filtration by class name/package name and it tries to load any class to check if it is entity, interface or not. And this can result that loader can go through the imports and find some imports of classes that are not in the classpath.
I think introducing some file name/package name regex filtration prior loading/processing class will help to mitigate those issues. Just class will be skipped by transformer/enhancer it the very beginning.
Also probably it is a good idea to pre-populate it with well known packages - spring, hibernate, ehcache etc