Skip to content

Remove support for Hibernate ORM proxy generation at static init #46847

@yrodiere

Description

@yrodiere

Description

The Quarkus extension for Hibernate should already generate all proxies at build time. Currently, if we need to generate a proxy at static init, we trigger a warning and ask people to report it.

See:

if (preGeneratedProxy == null) {
if (match) {
LOGGER.warnf("Unable to find a build time generated proxy for entity %s",
persistentClass.getClassName());
} else {
//TODO: this should be changed to an exception after 1.4
//really it should be an exception now
LOGGER.errorf(
"Unable to use a build time generated proxy for entity %s, as the build time proxy " +
"interfaces %s are different to the runtime ones %s. This should not happen, please open an " +
"issue at https://github.com/quarkusio/quarkus/issues",
persistentClass.getClassName(), preProxy.getProxyInterfaces(), proxyInterfaces);
}
Class<?> proxyDef = byteBuddyProxyHelper.get().buildProxy(mappedClass, toArray(proxyInterfaces));
return proxyDef;
} else {
return preGeneratedProxy;
}

We had no such report in years, AFAICT. Let's change this warning to an error and remove all code that supports generating proxies at static init. This would include using a no-op bytecode provider (similar to io.quarkus.hibernate.orm.runtime.service.bytecodeprovider.RuntimeBytecodeProvider) at static init.

See also hibernate/hibernate-orm#9831 (comment)

Implementation ideas

No response

Metadata

Metadata

Assignees

Labels

area/hibernate-ormHibernate ORMarea/housekeepingIssue type for generalized tasks not related to bugs or enhancements

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions