Hello,

I know it's quite old and maybe it's solved, but I had a similar issue with the message ERROR #815: User not authorized for service %Service_WebGateway

In my case, the problem was in the resources setup (/csp/sys/sec/%25CSP.UI.Portal.Resources.zen). By giving public permission to the gateway , the system started to work:

Hope this helps!

Just for fun, or to see if AI matches the experts, I've asked the question to Mixtral. This is what it is explaining:

Yes, I can certainly explain the difference between %ResultSet.SQL and %SQL.Statement in Intersystems Cache ObjectScript.

%ResultSet.SQL is a class that provides a result set interface for executing SQL queries. It allows you to iterate over the rows returned by a SQL query and access the columns as properties of each row. Here's an example of how to use %ResultSet.SQL:

SET rs = ##class(%ResultSet.SQL).%Open("SELECT * FROM mytable")
DO WHILE (rs.%Next()) {
    SET column1 = rs.column1
    SET column2 = rs.column2
    // Do something with the columns
}
rs.%Close()

On the other hand, %SQL.Statement is a class that provides a statement interface for executing SQL queries. It allows you to prepare a SQL statement and then execute it multiple times with different parameter values. Here's an example of how to use %SQL.Statement:

SET stmt = ##class(%SQL.Statement).%New()
DO stmt.%Prepare("SELECT * FROM mytable WHERE column1 = :val1 AND column2 = :val2")
DO stmt.%Execute(val1, val2)
DO WHILE (stmt.%Fetch()) {
    SET column1 = stmt.column1
    SET column2 = stmt.column2
    // Do something with the columns
}
stmt.%Close()

In summary, the main difference between %ResultSet.SQL and %SQL.Statement is that %ResultSet.SQL is used for iterating over the rows returned by a SQL query, while %SQL.Statement is used for preparing and executing a SQL statement multiple times with different parameter values.

David.Satorres6134 · Jun 29, 2024 go to post

Yes, I would totally recommend running it after any version upgrade. Won't do any harm, and surely solve issues related to changes on depending intersystems classes.

David.Satorres6134 · Jun 26, 2024 go to post

Who needs the flexibility and scalability of a database when you can just hardcode everything into the source code? I'm sure that'll make maintenance and updates a breeze.

Coming from someone with the PI expert badge, I take it as the near-official reason. Thanks for your help :-)

David.Satorres6134 · Jun 25, 2024 go to post

Hi Stephen,

Yes, that's what I finally did. But I was hoping there was some other way around "cleaner". It's kind or surprising to me that the parameters are not stored on a global, but it's just a class created with the values hard-coded in it.

Thanks for your help, in any case :)

David.Satorres6134 · Mar 13, 2024 go to post

This is great Kurro!

But this is the kind of things I would definetely take advantage of embeded python to speed up the development. To send a message using python, few lines of code are needed:

import pymsteams
myTeamsMessage = pymsteams.connectorcard(url) # Initialize the connector card with webhook URL
myTeamsMessage.text("This message will end up in team") # Message content
myTeamsMessage.send()   # Send the message

Hi,

You can use this set of instructions to compact and truncate any database:

s $namespace="%SYS", Percentage=100, Databasedir="d:\whatever"
d ##class(SYS.Database).CompactDatabase(Databasedir,Percentage)
d ##class(SYS.Database).GetDatabaseFreeSpace(Databasedir, .FreeSpace)
d ##class(SYS.Database).FileCompact(Databasedir, FreeSpace, .ActualFree)
d ##class(SYS.Database).ReturnUnusedSpace(Databasedir,0,.newsize)

David.Satorres6134 · Oct 26, 2022 go to post

Hi Michael,

I'm afraid the only way is to insert the record using SQL and use the  %NOTRIGGER and %NOINDEX keywords to prevent the actions.

Hi Veera,

Very nice article, embedding the python into cache itself without any classmethod fully coded as [Python]. If you are ok, I might try this code in real case scenario ;-)

Best regards

David.Satorres6134 · Dec 17, 2021 go to post

Hi Eduard,

This is basically same approach as mine, but straight with one single SQL operation.

Even if it works (it does, I've tested), in a database with potentially millions of records it seems to me that we would be missing background and multi-thread capacities. But by looking at the documentation I've been unable to find any method for that purpose.

Thanks for the answer, anyway! :-)

Hi Sean,

Sorry for the delay. You were absolutely right, I wasn't forwarding port 1972 but 51773! I just added 1972 and call the JDBC using this port and now it works like a charm.

Thanks!

Hi Dmitriy,

Correction: it's not ODBC by JDBC

Actually, when the container is running the error is different than when it's stopped, so I guess my python script really reaches the jdbc server but somehow is not accepted.

Container running:

java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: Communication error:  Server closed communication device

Container stopped:

java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: S’ha refusat la connexió (Connection refused)
David.Satorres6134 · Nov 24, 2020 go to post

Answering myself:

For a system with 8 cores, we will be allowed to use maximum 16 workers. So, to be able to do it and let other processes work with the default queue, we we just need to set the global:

 s ^%SYS("WQM","MaxActiveWorkers","User.Testing")=16

so, when creating the queue it can be done attaching the workers to this queue:

  set queue=$SYSTEM.WorkMgr.%New("/multicompile=1",16,"User.Testing")
David.Satorres6134 · Oct 16, 2020 go to post

Hi Brendan,

I wanted to use it to have an index not based on the Keys. Finally, I've solved it by storing the values as Array Of %String, and into the string I got the values separated by # so I can access them via $p. And using as a array key what I needed to be indexed.

It works quite well :-)

Thanks anyway for reporting it :-)

David.Satorres6134 · Aug 11, 2020 go to post

Ok then, I understand :-) JDBC works out of the box then, I can stop this JDBC gateway server right? And the users will be taken from the standard users database, exactly the same as when they access via ODBC. Am I correct?

Wow, what a big misunderstanding from my part :D

David.Satorres6134 · Aug 11, 2020 go to post

Hi,

Yes, no problem with SMP. Do I understand from your message than even if the JDBC gateway servers is set up at port 53773 users need to point their JDBC to 51773 (superserver port?)

David.Satorres6134 · Aug 11, 2020 go to post

Hi Robert,

Maybe I didn't make myself clear enough... customers can't reach the port:

$ telnet xxxxxxx.com 53773
Trying 172.23.2.84...
telnet: connect to address 172.23.2.84: Connection refused
telnet: Unable to connect to remote host: Connection refused

When I ask my Systems&Network department they say that IRIS is only "listening" to localhost (127.0.0.1), and that's the reason we cannot reach the port.

My understanding is that IRIS is bound to l0 interface instead to eth0. Am I completely wrong here?

David.Satorres6134 · Aug 10, 2020 go to post

Hi Dimitriy,

I saw you just released version 0.8.8 few days ago, but if I'm not wrong the sync ability is still not there, is it?

David.Satorres6134 · Jun 24, 2020 go to post

Ok thanks! I'll continue my integation when this update is available.

Very good job, by the way! :-)

David.Satorres6134 · Jun 20, 2020 go to post

Hi just managed to set it up and it's working.

One thing I miss: the ability to synchronise the code with the server. If somebody else has changed to code in the server, I don't see any alert or message. So, if I compile a class I'll be updating with an old code. Is there any way to achieve this, like I can do in Eclipse+Atelier?

Thanks!

David.Satorres6134 · Jun 20, 2020 go to post

I answer myself, in case someone is in the same issue.

WRC response was:
The short answer is that unfortunately there is no stand-alone kit for Atelier, as it is distributed only as a plug-in for Eclipse, and as such it follows the official Eclipse distribution mechanism.

But they gave me a few hints. Finally, I downloaded all the atelier package using wget from another computer, zipped it, copied to the computer and have it installed as local zip package. Worked like a charm :-)

David.Satorres6134 · Jun 18, 2020 go to post

Hi Dimitriy,

Im struggling to create a valid multi.code-workspace with several servers connected, but I fail. Do you have an example somewhere?

David.Satorres6134 · Jun 16, 2020 go to post

Hi Matthew,

Thanks for the answer. Can it be downloaded from the vscode marketplace? I actually don't work with dockers :'(

David.Satorres6134 · Feb 20, 2020 go to post

Thanks Alex.

But this other class gives as well the amount of bytes transferred and received ($p19 and $p20). And another bunch of numbers that I'd like to comprehend :-)

David.Satorres6134 · Feb 20, 2020 go to post

Hi Mikhail,

Where did you get the information for the meaning of the returned values from $system.ECP.GetProperty("ClientStats")?

Nice job, anyway ;-)