Class PgSQLXML

  • All Implemented Interfaces:
    SQLXML

    public final class PgSQLXML
    extends Object
    implements SQLXML
    The PgSQLXML implementation in the PostgreSQL JDBC driver has a dependency on the JDK's XML parsers; while the use of this type is a strong hint that the application's nature is relying on XML processing via the JDK standard libraries, we've observed that this type is also often included in the analysis graph being triggered via {@see java.sql.PreparedStatement#setObject}, which is widely used for other purposes as well. Considering that the efficiency costs of including all of resources and reflective registrations necessary to support the XML parsers is non trivial, we apply here a trick to help the GraalVM native image compiler avoid this inclusion unless this feature is actually is reachable, by isolating the construction of the parsers and their supporting other types via a reflective call. This reflective invocation exists merely to give us a control knob to toggle the inclusion of this code; it so happens that we can trigger the toggle automatically so to not manifest as semantic changes for the Quarkus users who don't need to know about this.
    Author:
    Sanne Grinovero