Nova postagem

查找

Resumo
· jan 25

Join the InterSystems Technical Article Contest

Dear member of the Developer Community!

We'd like to invite you to participate in our latest article writing contest:

✍️ InterSystems Technical Article Contest ✍️

Duration: February 3rd - March 2nd, 2025

🎁 Gifts for everyone + main prizes!

🔍 What’s the challenge? Write an article on any topic related to the InterSystems products and services.

>> Full details here

Get ready to shine and inspire others with your tech skills! We can't wait to see what you come up with. ✨

Pergunta
· jan 24

Connect to iris from Visual Studio

I am a volunteer at a nonprofit that is attempting to connect to a product that uses InterSystems Cache (Clinisys LIMS). I have not used this database before, but I have used many others (MS-SQL, Oracle, etc.). I am hoping IRIS is compatible enough with Cache for this project. 

I downloaded IRIS. I learned about Terminal [IRIS]. Using it I was able to create a new table, insert data, and retrieve it. I also used the Management Portal to query the new table. It also returned the data.

Next I attempted to connect with Visual Studio (MS VS 2022 Profesional). I downloaded the InterSystems.Data.IRISClient through NuGet. It was published 1/22/2025. It has only 21 downloads. (Quite strange!) 

I am using this C# code:

   var IRISConnect = new IRISADOConnection();
   IRISConnect.ConnectionString = cs.CreateCs();
   IRISConnect.Open();

I have tried many connection strings. This one seems the most promising:

var IRISConnect = new IRISADOConnection(host: "localhost", port: "1972", nsp: "USER", username: "username1234", password: "abcd1234");
IRISConnect.Open();

String queryString = "SELECT * FROM Test.Employee";
IRISCommand cmd4 = new IRISCommand(queryString, IRISConnect);
IRISDataReader Reader = cmd4.ExecuteReader();
while (Reader.Read())
    Console.WriteLine(Reader.GetValue(0).ToString());

Reader.Close();
cmd4.Dispose();
IRISConnect.Close();

The error occurs on the line, IRISConnect.Open(). It read, "IRIS Security Error". 

I am able to login to both the terminal and management portal with the username and password. The namespace "USER" appears in the management portal, so I believe it is okay as well. The port is listed under the "iris all" terminal command.

The SuperUser roles are "%All" in the Management Portal: System > Security Management > Users > Edit User - (security settings): Roles tab: Role Name.

The "Last Reason for Failing to Login" is "ERROR #5002: ObjectScript error: <READ>Logon+118^%SYS.DBSRV.1". 

How can I login to IRIS with .NET?

 

References: 

1) https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

2) https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

3) https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

4 Comments
Discussão (4)2
Entre ou crie uma conta para continuar
Artigo
· jan 24 2min de leitura

第六章 C 开头的术语

第六章 C 开头的术语

计算机名称 (computer name)

系统

分配给一个处理器、其外围设备及所有相关数据集的名称。这个名称在整个网络中必须唯一。另见系统名称。

并发模式 (concurrency mode)

对象(Objects

并发模式决定在打开和保存对象时执行何种类型的锁定。IRIS 支持五种并发模式(0-4),允许你指定不锁定、原子锁定、共享锁定、共享保留锁定和独占锁定。

并发 (concurrency)

对象(Objects)

并发通过锁定机制控制数据完整性。IRIS 支持五种并发模式,从不锁定到在对象加载到内存直到保存期间持有独占锁。默认情况下,IRIS 对所有对象使用原子锁定。

并发备份 (concurrent backup)

系统

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· jan 24

CPU and Memory utilization per namespace and business component

Hello,

Very much keen if we could gather the per namespace and business component utilization of InterSystems cache server.

For e. I have a PRD server where its CPU utilization is at max all the time and I want to know which namespace and its business process (service/Operation/Process) is utilizing what number of CPU and memory.

** I can get the CPU and Memory utilization per Cache.exe and PID, but not able to get the Namespace and ConfiguratioName to which that particular PID belongs.

 

Thank you,

5 Comments
Discussão (5)2
Entre ou crie uma conta para continuar
Artigo
· jan 24 3min de leitura

Connecting JDBC to MS Azure SQL through Microsoft Entra and Active Directory Password Authentication

Not sure there are many that connect to MS SQL to execute queries, stored procedures, etc, but our Healthsystem has many different MS SQL based databases we use within the Interoperability environment for various reasons.

With the push to moving from on-prem to the Cloud we ran into some difficulties with our SQL Gateway connections and knowing how to config them to use Microsoft Entra for Active Directory Authentication.

There are many articles out on the web, but there was not one that could give us the full answer to what we needed to do, and Microsoft wasn’t much help.
I figured I would write this out, so if there are others it might help.


Background
We are currently running RedHat 8.10 and openjdk version "1.8.0_432". Using the SQL Gateway we connect to MS SQL using the mssql-jdbc-12.2.0.jre8.jar driver with an Active Directory Service Account user.
jdbc:sqlserver://<server>:<port>;database=<database>;trustServerCertificate=true;integratedSecurity=true;authenticationScheme=NTLM;domain=<domain>;authentication=NotSpecified

 

When the database was moved to Azure SQL, I was given a new URL that included 
jdbc:sqlserver://<server>:<port>;databaseName=<database>;domain=<domain>;encrypt=true;trustServerCertificate=true;hostNameInCertificate=<server name>;Authentication=ActiveDirectoryPassword

 

When I clicked on Test Connection, I got 
Remote JDBC error: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to load MSAL4J Java library for performing ActiveDirectoryPassword authentication..

I tried updating the MS SQL JDBC driver to mssql-jdbc-12.8.1.jre8.jar but got the same error so something was still missing.

I then tried to connect using DBeaver, and eventually I was successful after some tweaks of the account. I then downloaded what DBeaver was using as the class file and uploaded the jar files onto my server. 

Working with WRC, I updated my %JDBC Server to use the path to the additional jar files and left my driver as the Class Path in my SQL Gateway Connection string.

However, Test Connection, would still throw an error.


Installing Maven
Microsoft had referred me to update Maven, but I had no clue what it was or how to use it. I tried manually downloading msal4j.jar but kept hitting error after error. The Maven Repository listed dependencies, so manually I tried downloading all the Dependency jar files but still could not get it to work.
There are many different ways to install Maven but I used… How to Install Maven on Windows, Linux, and Mac | Baeldung to figure out how to download it for my server, since “yum install maven” could not find the repository to download.

Once downloaded and installed, I had to add $JAVA_HOME, $M2_HOME, and $MAVEN_HOME to my .profile.


Downloading and installing necessary jar file and dependencies
In my troubleshooting of trying to connect to Azure SQL, I kept on getting an error message about msal4j.jar.
Using Maven from the command line… I executed
:>mvn dependency:get -Dartifact=com.microsoft.azure:msal4j:1.18.0

Which it downloaded msal4j.jar and all its dependencies to the .m2 repository on the local server.
From there I wanted to grab the jar files and copy them to the directory structure I had setup for IRIS. So I executed
:>mvn dependency:copy-dependencies -f /archive/.m2/repository/com/microsoft/azure/msal4j/ -DoutputDirectory=/nfs/data/drivers/java/

But using Maven you still have to copy the msal4j.jar, so I manually copied that jar file from the .m2 repository structure to /nfs/data/drivers/java/

Updating %JDBC Server and SQL Gateway Connection
To successfully connect, I had to make sure that all proper jar files were defined within the Class Paths.

So, on the %JDBC Server, I set the Class Path to /nfs/data/drivers/java/* which contained the msal4j.jar and all its dependencies.
Within the SQL Gateway Connection, I had to verify that the User had the appropriate domain defined, I reentered the password, clicked on Test Connection, and was able to get a Connection Successful.


In the end the hardest part was knowing how to download msal4j.jar and its dependencies to ensure that the proper authentication through Microsoft Entra would happen. 

So hopefully this will help someone down the road when trying to connect to Azure SQL Server using Active Directory Password Authentication through Microsoft Entra.

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