How to invalidate XSD cache without stopping and restarting Jetty Web server?

Wednesday, 10 January 2024 · 5 messages
Y
ykhabins10 Jan 2024 00:00 #
Hello, We are using BaseX 10.8 beta for XML files validation against the XSD. Our XSDs are conformant with the XSD 1.1 that why all necessary Apache Xerces 12.2.2 files are in the lib/custom directory. On top of that we are using Jetty Web server by launching c:\Program Files (x86)\BaseX\bin\basexhttp.bat Eventually, our REST HTTP call is as follow: string REQUESTURL = $"http://{HOST}:{PORT}/rest?run={XQUERY}&$xml={xmlFile}&$xsd={xsdFile}"; Our XQuery validation call is as follows: let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true(), 'cache': true() }) Everything is working as expected. :) Here is a question. =================== The validate:xsd-report(...) call is using caching via the 'cache': true() parameter. We are updating XSDs from time to time. Unfortunately, the validation is not picking up a new version of the XSD file on the file system. It is unaware that the *.xsd file was updated. It is still using an old XSD version that is cached in memory. Is it possible to invalidate the XSD cache without stopping and restarting Jetty Web server? IMHO, it is too intrusive. Maybe you can introduce a manual command for XSD cache invalidation in the BaseX GUI? Or some other mechanism to handle the scenario. Regards, Yitzhak Khabinsky
CG
Christian Grün10 Jan 2024 12:18 #
Hi Yitzhak, Thanks for the suggestion. Feel free to check out the latest stable snapshot, it contains two new functions for discarding cached XSD schemas and XSL transformers [1,2]. Best, Christian [1] https://github.com/BaseXdb/basex/issues/2267 [2] https://files.basex.org/releases/latest/
Quoted text · PM · 44 lines
On Tue, Jan 9, 2024 at 11:00 PM <ykhabins at bellsouth.net> wrote: > Hello, > > We are using BaseX 10.8 beta for XML files validation against the XSD. > Our XSDs are conformant with the XSD 1.1 that why all necessary Apache > Xerces 12.2.2 files are in the lib/custom directory. > On top of that we are using Jetty Web server by launching c:\Program Files > (x86)\BaseX\bin\basexhttp.bat > > Eventually, our REST HTTP call is as follow: > string REQUESTURL = > $"http://{HOST}:{PORT}/rest?run={XQUERY}&$xml={xmlFile}&$xsd={xsdFile}"; > > Our XQuery validation call is as follows: > let $result := validate:xsd-report($xml, $xsd, map { > 'http://apache.org/xml/features/validation/cta-full-xpath-checking': > true(), > 'cache': true() }) > > Everything is working as expected. :) > > Here is a question. > =================== > The validate:xsd-report(...) call is using caching via the 'cache': true() > parameter. > We are updating XSDs from time to time. > Unfortunately, the validation is not picking up a new version of the XSD > file on the file system. > It is unaware that the *.xsd file was updated. > It is still using an old XSD version that is cached in memory. > > Is it possible to invalidate the XSD cache without stopping and restarting > Jetty Web server? > IMHO, it is too intrusive. > Maybe you can introduce a manual command for XSD cache invalidation in the > BaseX GUI? > Or some other mechanism to handle the scenario. > > Regards, > Yitzhak Khabinsky > > > >
Y
ykhabins10 Jan 2024 17:16 #
Hi Mr. Grun, Thanks for such super quick turnaround! It seems that the first link [1] https://github.com/BaseXdb/basex/issues/2267 shows incorrect function signature as validate:xsd-init(). Shouldn't it be validate:init()? Regards, Yitzhak Khabinsky
Quoted text · Christian Grün · 43 lines
From: Christian Grün <christian.gruen at gmail.com> Sent: Wednesday, January 10, 2024 6:19 AM To: ykhabins at bellsouth.net Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] How to invalidate XSD cache without stopping and restarting Jetty Web server? Hi Yitzhak, Thanks for the suggestion. Feel free to check out the latest stable snapshot, it contains two new functions for discarding cached XSD schemas and XSL transformers [1,2]. Best, Christian [1] https://github.com/BaseXdb/basex/issues/2267 [2] https://files.basex.org/releases/latest/ On Tue, Jan 9, 2024 at 11:00 PM <mailto:ykhabins at bellsouth.net> wrote: Hello, We are using BaseX 10.8 beta for XML files validation against the XSD. Our XSDs are conformant with the XSD 1.1 that why all necessary Apache Xerces 12.2.2 files are in the lib/custom directory. On top of that we are using Jetty Web server by launching c:\Program Files (x86)\BaseX\bin\basexhttp.bat Eventually, our REST HTTP call is as follow: string REQUESTURL = $"http://{HOST}:{PORT}/rest?run={XQUERY}&$xml={xmlFile}&$xsd={xsdFile}"; Our XQuery validation call is as follows: let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true(), 'cache': true() }) Everything is working as expected. :) Here is a question. =================== The validate:xsd-report(...) call is using caching via the 'cache': true() parameter. We are updating XSDs from time to time. Unfortunately, the validation is not picking up a new version of the XSD file on the file system. It is unaware that the *.xsd file was updated. It is still using an old XSD version that is cached in memory. Is it possible to invalidate the XSD cache without stopping and restarting Jetty Web server? IMHO, it is too intrusive. Maybe you can introduce a manual command for XSD cache invalidation in the BaseX GUI? Or some other mechanism to handle the scenario. Regards, Yitzhak Khabinsky
Y
ykhabinsin reply to Christian Grün, 10 Jan 2024, 12:1810 Jan 2024 17:23 #
Mr. Grun, It is probably better to fix the actual source code: _VALIDATE_XSD_INIT(ValidateXsdInit::new, "init()", As follows: _VALIDATE_XSD_INIT(ValidateXsdInit::new, "xsd-init()", Regards, Yitzhak Khabinsky
Quoted text · Christian Grün · 50 lines
-----Original Message----- From: ykhabins at bellsouth.net <ykhabins at bellsouth.net> Sent: Wednesday, January 10, 2024 10:16 AM To: 'Christian Grün' <christian.gruen at gmail.com> Cc: 'BaseX' <basex-talk at mailman.uni-konstanz.de> Subject: RE: [basex-talk] How to invalidate XSD cache without stopping and restarting Jetty Web server? Hi Mr. Grun, Thanks for such super quick turnaround! It seems that the first link [1] https://github.com/BaseXdb/basex/issues/2267 shows incorrect function signature as validate:xsd-init(). Shouldn't it be validate:init()? Regards, Yitzhak Khabinsky From: Christian Grün <christian.gruen at gmail.com> Sent: Wednesday, January 10, 2024 6:19 AM To: ykhabins at bellsouth.net Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] How to invalidate XSD cache without stopping and restarting Jetty Web server? Hi Yitzhak, Thanks for the suggestion. Feel free to check out the latest stable snapshot, it contains two new functions for discarding cached XSD schemas and XSL transformers [1,2]. Best, Christian [1] https://github.com/BaseXdb/basex/issues/2267 [2] https://files.basex.org/releases/latest/ On Tue, Jan 9, 2024 at 11:00 PM <mailto:ykhabins at bellsouth.net> wrote: Hello, We are using BaseX 10.8 beta for XML files validation against the XSD. Our XSDs are conformant with the XSD 1.1 that why all necessary Apache Xerces 12.2.2 files are in the lib/custom directory. On top of that we are using Jetty Web server by launching c:\Program Files (x86)\BaseX\bin\basexhttp.bat Eventually, our REST HTTP call is as follow: string REQUESTURL = $"http://{HOST}:{PORT}/rest?run={XQUERY}&$xml={xmlFile}&$xsd={xsdFile}"; Our XQuery validation call is as follows: let $result := validate:xsd-report($xml, $xsd, map { 'http://apache.org/xml/features/validation/cta-full-xpath-checking': true(), 'cache': true() }) Everything is working as expected. :) Here is a question. =================== The validate:xsd-report(...) call is using caching via the 'cache': true() parameter. We are updating XSDs from time to time. Unfortunately, the validation is not picking up a new version of the XSD file on the file system. It is unaware that the *.xsd file was updated. It is still using an old XSD version that is cached in memory. Is it possible to invalidate the XSD cache without stopping and restarting Jetty Web server? IMHO, it is too intrusive. Maybe you can introduce a manual command for XSD cache invalidation in the BaseX GUI? Or some other mechanism to handle the scenario. Regards, Yitzhak Khabinsky
CG
Christian Grün10 Jan 2024 18:17 #
;) Right, thanks. An updated version is online.
Quoted text · PM · 96 lines
On Wed, Jan 10, 2024 at 4:23 PM <ykhabins at bellsouth.net> wrote: > Mr. Grun, > > It is probably better to fix the actual source code: > _VALIDATE_XSD_INIT(ValidateXsdInit::new, "init()", > > As follows: > _VALIDATE_XSD_INIT(ValidateXsdInit::new, "xsd-init()", > > Regards, > Yitzhak Khabinsky > > -----Original Message----- > From: ykhabins at bellsouth.net <ykhabins at bellsouth.net> > Sent: Wednesday, January 10, 2024 10:16 AM > To: 'Christian Grün' <christian.gruen at gmail.com> > Cc: 'BaseX' <basex-talk at mailman.uni-konstanz.de> > Subject: RE: [basex-talk] How to invalidate XSD cache without stopping and > restarting Jetty Web server? > > Hi Mr. Grun, > > Thanks for such super quick turnaround! > > It seems that the first link [1] > https://github.com/BaseXdb/basex/issues/2267 > shows incorrect function signature as validate:xsd-init(). > Shouldn't it be validate:init()? > > Regards, > Yitzhak Khabinsky > > From: Christian Grün <christian.gruen at gmail.com> > Sent: Wednesday, January 10, 2024 6:19 AM > To: ykhabins at bellsouth.net > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] How to invalidate XSD cache without stopping and > restarting Jetty Web server? > > Hi Yitzhak, > > Thanks for the suggestion. Feel free to check out the latest stable > snapshot, it contains two new functions for discarding cached XSD schemas > and XSL transformers [1,2]. > > Best, > Christian > > [1] https://github.com/BaseXdb/basex/issues/2267 > [2] https://files.basex.org/releases/latest/ > > > On Tue, Jan 9, 2024 at 11:00 PM <mailto:ykhabins at bellsouth.net> wrote: > Hello, > > We are using BaseX 10.8 beta for XML files validation against the XSD. > Our XSDs are conformant with the XSD 1.1 that why all necessary Apache > Xerces 12.2.2 files are in the lib/custom directory. > On top of that we are using Jetty Web server by launching c:\Program Files > (x86)\BaseX\bin\basexhttp.bat > > Eventually, our REST HTTP call is as follow: > string REQUESTURL = > $"http://{HOST}:{PORT}/rest?run={XQUERY}&$xml={xmlFile}&$xsd={xsdFile}"; > > Our XQuery validation call is as follows: > let $result := validate:xsd-report($xml, $xsd, map { > 'http://apache.org/xml/features/validation/cta-full-xpath-checking': > true(), > 'cache': true() }) > > Everything is working as expected. :) > > Here is a question. > =================== > The validate:xsd-report(...) call is using caching via the 'cache': true() > parameter. > We are updating XSDs from time to time. > Unfortunately, the validation is not picking up a new version of the XSD > file on the file system. > It is unaware that the *.xsd file was updated. > It is still using an old XSD version that is cached in memory. > > Is it possible to invalidate the XSD cache without stopping and restarting > Jetty Web server? > IMHO, it is too intrusive. > Maybe you can introduce a manual command for XSD cache invalidation in the > BaseX GUI? > Or some other mechanism to handle the scenario. > > Regards, > Yitzhak Khabinsky > > > >

⚡Generated with XQuery