As discussed in https://github.com/oracle/graal/issues/5073, our session-jdbc AOT smoke test sample currently registers reflection entry for org.springframework.jdbc.datasource.embedded.EmbeddedDatabase#shutdown instead of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory$EmbeddedDataSourceProxy#shutdown.

It comes from EmbeddedDataSourceConfiguration and the inference is done here. The reflection registration on the class instance is needed to make it work on GraalVM 22.3 (we are not sure why that does not break on 22.2). By design, we can't know the concrete type of the EmbeddedDatabase without instantiating the bean which is not possible at AOT stage I think.

As discussed with @wilkinsona in https://github.com/spring-projects/spring-boot/issues/32581, it should be Spring Framework responsibility to provide an arrangement that works out of the box. Providing hints with a type reachable condition on EmbeddedDatabaseFactory is IMO a good enough way to achieve that.