About adding a nice SPI… Remember how this whole code in Quarkus is a hack that runs in an integrator, because we need the metadata to generate scripts, and the metadata is no longer available after we build the session factory? Well… now the metadata is in the session factory; it’s stored in the SchemaManager, which allows creating/dropping the schema at runtime: https://github.com/hibernate/hibernate-orm/blob/ed956d514a74417125b141d5514c5b70748c819e/hibernate-core/src/main/java/org/hibernate/relational/internal/SchemaManagerImpl.java#L25-L28 I thought we didn’t want to keep the metadata around at runtime, because it’s huge and leads to increased memory consumption? I thought we wanted that stuff garbage-collected ASAP? It’s probably also a problem when compiling to native as having those classes around will lead to many more classes/methods being included in executables… Though maybe that’s only a problem if there is actually code that uses the SchemaManager. Sanne Grinovero any opinion on this? Did you detect increased memory usage or higher native binary size in your benchmarks? |