Message-ID: From: "eitch (@eitch)" To: "pgjdbc/pgjdbc" Date: Tue, 29 Jul 2025 13:23:10 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3221: Performance degradation of XML operations under Java 21 with custom parsers/transformers In-Reply-To: References: List-Id: X-GitHub-Author-Login: eitch X-GitHub-Comment-Id: 3132528521 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3221 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3221#issuecomment-3132528521 Content-Type: text/plain; charset=utf-8 I'm running into a similar issue, as it seems a client has issues with their infrastructure where these frequent reloads leads to slow transactions. I've now tried to add a customer factory but i am running into a bug where it says my implementation is not implementing the interface. This is my class: ```java import org.postgresql.xml.EmptyStringEntityResolver; import org.postgresql.xml.NullErrorHandler; import org.postgresql.xml.PGXmlFactoryFactory; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXTransformerFactory; public class CachingPGXmlFactoryFactory implements PGXmlFactoryFactory { @Override public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { return this.documentBuilder; } @Override public TransformerFactory newTransformerFactory() { return this.transformerFactory; } @Override public SAXTransformerFactory newSAXTransformerFactory() { return this.saxTransformerFactory; } @Override public XMLInputFactory newXMLInputFactory() { return this.xmlInputFactory; } @Override public XMLOutputFactory newXMLOutputFactory() { return this.xmlOutputFactory; } @Override public XMLReader createXMLReader() throws SAXException { return this.xmlReader; } } ``` and i get the following exception when using the class: ``` Connection property xmlFactoryFactory must implement PGXmlFactoryFactory: li.strolch.persistence.postgresql.CachingPGXmlFactoryFactory ```