Rechercher

Résumé
· Nov 10, 2025

Publications des développeurs d'InterSystems, semaine Novembre 03 - 09, 2025, Résumé

Novembre 03 - 09, 2025Week at a GlanceInterSystems Developer Community
Question
· Nov 10, 2025

Foreign Table datatypes

Hello!

I'm trying to create some foreign tables to a PostgreSQL database. In some cases, columns with certain datatypes cannot be consumed by IRIS and the following error is thrown:

 [SQLCODE: <-237>:<Schema import for foreign table did not return column metadata>]

  [%msg: <Unkown data type returned by external database>]

For example: serial4 typed ID columns are typical examples. Is it possible, what's the best way of resolving these datatypes, which- seemingly- don't have proper JDBC metadata mappings?

Of course, explicitely defining columns and types as part of the CREATE FOREIGN TABLE statement solves the problem, but when working with large number of foreign tables and unknown number of potentially problematic datataypes, this can be cumbersome.

 

Thank you for any help in advance!

Attila Toth

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2025 3m de lecture

_spec para swagger-ui desde la clase de spec

Seguramente queríais usar la especificación OpenAPI (OAS) en formato JSON que utilizasteis para vuestra clase spec en el paquete iris-web-swagger-ui de IRIS.
La OAS generada por el método ##class(%REST.API).GetWebRESTApplication(...) es muy básica, sin descripciones de los parámetros ni de la estructura esperada de las respuestas.

Así que, después de crear vuestra aplicación REST a partir de una OAS, deberíais tener:

  • Una clase application.disp.cls generada
  • Una clase application.spec.cls (añadiremos una ruta hacia la especificación OpenAPI que se encuentra en la propiedad "XData OpenAPI")
  • Una clase application.impl.cls (solo implementaremos el método GetSpec)

Si instalasteis el paquete iris-web-swagger-ui (https://openexchange.intersystems.com/package/iris-web-swagger-ui), necesitáis un endpoint que devuelva la OAS.

Mi enfoque consiste en añadir una ruta hacia la OAS en la clase spec y aplicarla usando la propiedad "OpenAPI" de dicha clase spec. Esto os permitirá, por ejemplo, tener disponible para pruebas toda la estructura del OAS original.

En la clase de ejemplo del paquete iris-web-swagger-ui (Sample.PersonREST), hay una implementación del método SwaggerSpec que actualiza algunas propiedades para reflejar lo que está configurado en la Aplicación Web de IRIS. Si seguís este procedimiento, recomiendo actualizar directamente la OAS en la clase spec para proporcionar esa información y así centralizar la documentación de vuestra API (aunque siempre podéis actualizarla en el método GetSpec que os muestro como ejemplo).

Siguiendo el ejemplo de la clase Sample.PersonREST, la ruta será /_spec. Aunque existe un valor para la etiqueta "basePath", este será reemplazado por el nombre de la Aplicación Web de IRIS.

Class application.spec Extends %REST.Spec [ProcedureBlock]
{

XData OpenAPI [ MimeType = application/json ]
{
{
  ...
  "basePath":"/api/myapi",
  ...
  "paths":{
    "/_spec": {
      "get":{
        "operationId":"GetSpec",
        "description":"This OpenAPI Spec",
        "produces":[
          "application/json"
        ],
        "responses":{
          "200":{
            "description":"Successful operation"
            }
          }
        }
    }, 
...

Lo siguiente es pegar este código sencillo en la clase de implementación. Concretamente, después de compilar la clase spec, la clase impl tiene un nuevo método (GetSpec) que debe devolver un objeto dinámico (el comentario principal proviene de la OAS en la clase spec y de la etiqueta "description" del "get" en la ruta). Debéis reemplazar "application.spec" por la referencia a vuestra propia clase de aplicación.

/// This OpenAPI Spec
ClassMethod GetSpec() As %DynamicObject
{
    Set spec = {}.%FromJSON(##class(%Dictionary.CompiledXData).%OpenId("application.spec||OpenAPI").Data.Read())
    Set spec.basePath = %request.Application
    Return spec
}

¡Eso es todo!

Ahora id a vuestro iris-web-swagger-ui (en mi caso, http://localhost:52773/swagger-ui/index.html) y probad explorando en “http://localhost:52773/api/myapi/_spec” dentro del campo de navegación de swagger-ui.

Nota: definí una Aplicación Web llamada /api/myapi con “application.disp” como su “clase de despacho” (Dispatch class).

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2025 2m de lecture

FastJsonSchema: Native High-Performance JSON Validation for IRIS

FastJsonSchema: High-Performance JSON Validation in IRIS

Validating JSON data against JSON Schema is a common requirement for modern applications. FastJsonSchema brings this capability natively to InterSystems IRIS, combining speed, simplicity, and full schema compliance.

Unlike traditional validation approaches, FastJsonSchema generates native ObjectScript code from your JSON Schemas and compiles it directly to iris object code, enabling idiomatic performance without relying on external libraries or runtimes.

Why Use FastJsonSchema?

  • Native IRIS Code Generation – Compile your JSON Schema directly into ObjectScript and object code for lightning-fast execution.
  • High Performance – Fine-grained optimizations provide significant speed improvements, especially for repeated validations.
  • Detailed Validation – Validate at the property level with full adherence to JSON Schema rules.
  • Simple API – Compile schemas and validate JSON in just a few lines of code.
  • No External Dependencies – 100% native; no Python, Java, or other runtimes required.
  • Reusable Precompiled Schemas – Compile once, validate many times, reducing runtime overhead.

Supported JSON Schema Drafts

  • Draft-07

Getting Started

Compile a JSON Schema into native code:

Set sc = ##class(FastJsonSchema.Core).Compile(schema, schemaName)

Validate JSON data against a compiled schema:

Set sc = ##class(FastJsonSchema.Core).Validate(schemaName, pJSON)

Performance Tips

  • Compile Once, Use Many Times – Precompile schemas to object code to maximize speed.
  • Use Granular Schemas – Breaking complex JSON objects into smaller schemas improves validation efficiency.
  • Handle Exceptions Gracefully – Catch to manage invalid JSON cleanly.

With FastJsonSchema, Achieve the perfect balance of performance and flexibility — validating JSON data natively, efficiently, and with confidence.

1 Comment
Discussion (1)1
Connectez-vous ou inscrivez-vous pour continuer
Question
· Nov 10, 2025

CSPGatewayLatency Alert, what does it mean? How should be managed?

Hello, thanks for your time reading this question.

We are receiving each day, alerts from one of our four Production nodes. It always has the same text:

 

[InterSystems IRIS SEVERE ERROR gchciris4.canariasalud:ENSEMBLE] [Utility.Event] [SYSTEM MONITOR] CSPGatewayLatency(127.0.0.1:443) Alert: CSPGatewayLatency = 5001.304, 5001.233, 5000.964 (Max value is 2000).

 

We have looked for it in the documentation here:

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

 

We thought it was related to the following paragraph:

"Server Response Timeout

The maximum number of seconds allowed for the target Caché server to respond to a request from the web server. The timeout refers to a period of no activity, so, for example, sending a line of HTML data every second for 10 hours does not cause a timeout. The minimum allowable value for this field is 5 seconds.

The value set here is the default for the system. If an Inherited Value is specified, the value came from the Default Parameters page. You may, however, set a different value on individual server-specific configurations or within the application itself.

Note that if you have an Apache server, you can also set this value using Timeout in the Apache http.conf file. The lower of these two values is triggered first."

 

 

However, we suppose that CSP Gateway Latency of maximum 2 seconds is not related to Server Response Timeout by default limited to 5 seconds.

 

We just want to understand the Node error. Could you please point to the documentation where it is explained?

 

We need to understand it prior to solve it.

 

We have also looke for "CSPGatewayLatency" using the forum search text area, but it does not pop up relevant results.

https://community.intersystems.com/smartsearch?search=CSPGatewayLatency

 

Could you please help us? Thank you so much.

 

We have also seen this example:

Update Default Parameter(s)

Kill newpars
Set newpars("Server_Response_Timeout")=30
Do gateway.SetDefaultParams(.newpars)

Found here: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

 

And this old post:

https://community.intersystems.com/post/cache-monlbl-response-time-question

 

Could your help us, please? Thanks.

5 Comments
Discussion (5)3
Connectez-vous ou inscrivez-vous pour continuer