Nova postagem

Pesquisar

Pergunta
· Mar. 7

EnsLib.JavaGateway.Service to remote JavaGateway

Hello, dear colleagues.

 

I need to connect to a remote JavaGateway from an Ensemble service.

I am trying to use the EnsLib.JavaGateway.Service with a remote host where the JVM is running.

 

I can successfully ping the remote Java Gateway from EnsLib.JavaGateway.Service, and Ensemble reports that the service status is OK.

There are no network issues, and all necessary ports are accessible.

 

My requests work without any problems when I specify localhost in EnsLib.JavaGateway.Service. However, when I specify a remote JVM, I get the following error:

#5023: Error Java-gateway: Connection cannot be established

Do you have any experience running the JVM for EnsLib.JavaGateway.Service on a remote host?

I am also attaching a diagram for better understanding of what I am trying to achieve.

 

Below is the getLogFile log from intersystems-gateway-3.1.0.jar:

 >> PING

Sent: (18:26:01:582) [Job number = -1] [ThreadID = 67]

  0000:  00  00  00  00  00  00  00  00  00  00  00  00  59  51      ............YQ

 << PING

Received: (18:26:01:582) [Job number = -1] [ThreadID = 67]

  0000:  00  00  00  00  00  00  00  00  00  00  00  00  59  34      ............Y4

 >> DISCONNECT

Sent: (18:26:01:582) [Job number = -1] [ThreadID = 67]

  0000:  00  00  00  00  00  00  00  00  00  00  00  00  59  34      ............Y4

 << DISCONNECT

Received: (18:26:11:585) [Job number = -1] [ThreadID = 68]

  0000:  00  00  00  00  00  00  00  00  00  00  00  00  59  51      ............YQ

 

The versions I am using:

java -version

openjdk version "1.8.0_442"

OpenJDK Runtime Environment (build 1.8.0_442-b06)

OpenJDK 64-Bit Server VM (build 25.442-b06, mixed mode)

The command I use to start JavaGateway on the remote host:

java -classpath /opt/intersystems-gateway-3.1.0.jar:/opt/intersystems-jdbc-3.1.0.jar com.intersystems.gateway.JavaGateway 55560 "/tmp/jdbc.log" "" 0.0.0.0

1 Comment
Discussão (1)2
Entre ou crie uma conta para continuar
Artigo
· Mar. 7 2min de leitura

SQL Query Stopped Working After Changing %String Property to Wrapper Types

We recently changed the 'UserID" property in a "User" class from type of %String to be %Library.Username. This is for better consistency across our codebase regarding MAXLEN limit.

%Library.Username is a system wrapper datatype which extends %String and has a MAXLEN of 160. This change should have minimal/no impact on code behavior. However, we found that some SQL query cannot return expected rows after the change. Query will return empty values even if the entry is in the table.

After investigation, we found that re-building index could solve the issue, which means the data type change caused some inconsistency for existing index on the property. But why would a simple wrapper class of String make any difference in SQL table?

 

==================================================================================

Answer:

The reason index stopped working is that it was built when the property was still a %String.

So what's the difference between %Library.String and %Library.Username? They are both %String. But aside from MAXLEN, another key difference is the default COLLATION.

In SQL, by default, an index on a given property (or properties) uses the collation type of the property data. For %Library.String, there is a system-wide (namespace-wide) default COLLATION="SQLUPPER" (this default can be changed, see the documentation below). This means that if we have a row with UserID="JoeFu", it’s stored in the UserIDIndex global as " JOEFU".

For WHERE clause comparison: UserID="JoeFu", with default collation of UserID="SQLUPPER", the SQL engine evaluates it as %SQLUPPER(UserID)=%SQLUPPER("JoeFu").

However, when we switch to %Library.Username, there is no default COLLATION anymore (sadly, even if this type is pretty much just %String). Now, without "SQLUPPER" collation, SQL engine evaluates this equal condition as it is: UserID="JoeFu", then query optimizer decides to use the index built upon UserID, without rebuilding this index, we still have %SQLUPPER(UserID) in this index global. When it looks for "JoeFu" without such collation, it cannot find a match.

NOTE: when creating/using datatype that replacing %String, should pay attention to the usage of the property and its index, it's very possible that you need to set COLLATION="SQLUPPER" to match things in the existing SQL table

See https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_stringmanipulation#RSQL_stringmanipulation_desc for SQL string collation.

See https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_collation#GSQL_collation_ns for the setting of default collation on IRIS

See https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_collation#GSQL_collation_indexdef for Index collation.

Thanks Yuchen Liu for answering my initial question!

3 Comments
Discussão (3)1
Entre ou crie uma conta para continuar
Pergunta
· Mar. 7

Dynamic SQL Queries with a ROUTINE (CODE) database mounted in read-only mode: ERROR #5002: ObjectScript error: <UNDEFINED>ShowPlan+6^%apiSQL *sqlOrig

Using IRIS 2024.1.2 when I mount the routine database as read-only I get an error when executing dynamic SQL queries.

What globals need to be mapped in a read-write database in order to allow execution plans to be written?

1 Comment
Discussão (1)1
Entre ou crie uma conta para continuar
Pergunta
· Mar. 7

Requêtes SQL Dynamique avec une base de ROUTINE (CODE) montée en lecture seule : ERROR #5002: ObjectScript error: <UNDEFINED>ShowPlan+6^%apiSQL *sqlOrig

En utilisant IRIS 2024.1.2 lorsque je monte la base de données de routine en lecture seule, j'obtiens une erreur lors de l'exécution de requêtes SQL dynamique.

Quelles globales doivent être mappées dans une base de données en lecture-écriture afin de permettre l'écriture des plans d'exécutions ?

Discussão (0)1
Entre ou crie uma conta para continuar
InterSystems Oficial
· Mar. 7

Descontinuação do MultiValue no InterSystems IRIS 2025.1

A partir da plataforma de dados InterSystems IRIS® versão 2025.1, a InterSystems está oficialmente descontinuando o MultiValue e incluindo-o na lista de Recursos Descontinuados e Obsoletos. Embora a InterSystems continue a oferecer suporte aos clientes existentes que usam o MultiValue, ele não é recomendado para novos aplicativos.

O Que Isso Significa:

  • Suporte Contínuo: O suporte para MultiValue ainda estará disponível por meio do Worldwide Response Center (WRC) em uma base de "melhor esforço", como é fornecido para lançamentos mais antigos do que nossas Versões Mínimas Suportadas.
  • Possibilidade de Remoção Futura: Embora não haja planos imediatos para remover o MultiValue de nossos produtos, a InterSystems reserva-se o direito de fazê-lo em um lançamento futuro.
  • Orientação ao Cliente: Se você tiver dúvidas sobre seu uso atual ou planejado do MultiValue, recomendamos que você entre em contato com sua equipe de conta da InterSystems para obter orientação.

A designação obsoleta sinaliza que os clientes devem planejar eliminar o uso do MultiValue. Reconhecemos que isso pode impactar projetos em andamento e agradecemos sua cooperação à medida que continuamos a evoluir nossa plataforma.

Para mais informações ou preocupações, sinta-se à vontade para comentar abaixo ou entrar em contato com seu representante da InterSystems.

Discussão (0)1
Entre ou crie uma conta para continuar