Alexander Koblov · Nov 15, 2018 go to post

I'm also talking about %SYS level.

For example, stop JDBC Gateway server. Then go to SQL Gateway Connections. Choose any JDBC connection, click "Test Connection". You should receive "Connection successful".

Now go back to JDBC Gateway Server and notice that its process is running. It was started automatically when you clicked "Test Connection"

Alexander Koblov · Nov 15, 2018 go to post

Hi Scott.

JDBC Gateway already automatically stops when Caché is stopped. And automatically started on first attempt to use it.

So maybe you don't need to do anything specific here.

Alexander Koblov · Oct 18, 2018 go to post

a) I think no, performance will not improve if you have nine SQLGateways.

SQLGateway ODBC connection is established in each process.

So each separate Caché process has each own connection to the SQLServer.

b) As to the SQLGateway performance. I think first thing you need to check is how SQLServer itself handles these nine queries being run simultaneusly. If it's fast, and slow only via SQLGateway connection, then it makes sense to look into if something can be configured on SQLGateway / Caché side.

Alexander Koblov · Oct 4, 2018 go to post

Tuan,

$.TotalSteps seem to work OK in curl:

C:\utl>curl -i -X POST -H "Content-Type: application/json" http://localhost:52774/api/docdb/v1/USER/db/TestDB
HTTP/1.1 201 Created
...

{"content":{"Name":"TestDB","Class":"ISC.DM.TestDB","properties":[{"Name":"%%OID","Type":"%Library.RawString"},{"Name":"%Concurrency","Type":"%Library.RawString"},{"Name":"%Doc","Type":"%Library.DynamicAbstractObject"},{"Name":"%DocumentId","Type":"%Library.Integer"},{"Name":"%LastModified","Type":"%Library.UTC"}]}}


C:\utl>curl -i -X POST -H "Content-Type: application/json" http://localhost:52774/api/docdb/v1/USER/prop/TestDB/TotalSteps?type=%Integer&path=$.TotalSteps
HTTP/1.1 201 Created
...

{"content":{"Name":"TotalSteps","Type":"%Library.Integer"}}

What error do you get?

Alexander Koblov · Oct 3, 2018 go to post

Yes,

there is an API to export and import web-applications info to and from file.

To export:

%SYS>write ##class(Security.Applications).Export("c:\temp\webapp.xml",.n,"/csp/samples,/csp/user")

To import:

%SYS>write ##class(Security.Applications).Import("c:\temp\webapp.xml",.n)
1
%SYS>write n
2
Alexander Koblov · Oct 3, 2018 go to post

No, it's not safe to use %NOLOCK on INSERT query.

Doc says following:

%NOLOCK ... should only be used when a single user/process is updating the database. 

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

If you use INSERT with %NOLOCK, then some other process might UPDATE partially inserted row.

Rows inserted as follows: a) Save inserted row (fill Data global) b) File index values for inserted row (fill Index global)

Imagine there are two parallel processes A and B. A inserts row with %NOLOCK. B updates the same row without %NOLOCK.

t1) A saves row, filling Data global t2) B updates the same row, overwriting the value in Data global t3) B fills Index global with values corresponding to new data of row t4) A fills Index global with values corresponding to old data of row (as of Insert time)

Now you have row in the table with wrong indices.

Also, please notice that if there is inheritance in classes -- E.g. Sample.Employee inherits from Sample.Person. Then storing row in Data global is at least two SETs, so you might end up with corrupted row, not only wrong index. Also filing index records is not atomic. Each index record is separate SET.

So, I would not recommend to use %NOLOCK. There is one possible use case for %NOLOCK -- bulk-loading data, but there should be only one process accessing the data while loading.

Alexander Koblov · Sep 18, 2018 go to post

Hi Xiao.

Many people here know Caché. Not so many know Oracle.

If you would explain what is Oracle CDC. What it does, and what features do you need, then we would be able to answer how you can do this in Caché.

Thank you, Alexander.

Alexander Koblov · Sep 12, 2018 go to post

Daniel,

in the guide https://community.intersystems.com/post/k-means-clustering-iris-dataset Niyaz connects to the InterSystems IRIS using user 'dev' and password '123'. Did you change that to user/password that exists on your system?

Access Denied error usually means incorrect credentials or lack of required privileges.

You can try to enable Audit in IRIS (Management Portal -> System Administration -> Security -> Auditing). Then enable LoginFailure and Protect events (Auditing -> Configure System Events).

Then reproduce the error and check audit (Auditing -> View Audit Database). If LoginFailure or Protect events appeared -- click on Details, they might give some hints of why you are getting "Access Denied".

Alexander Koblov · Sep 7, 2018 go to post

These are credentials for CSP Gateway to use for connecting to Caché. If there is no such username/password pair in Caché or if corresponding user does not have enough privileges, then this username/password pair is not valid.

Alexander Koblov · Sep 7, 2018 go to post

Yes.

USER>set reg = $system.CSP.GetGatewayRegistry()

USER>set managers = reg.GetGatewayMgrs("a")

USER>write managers.Size // you can have many CSP Gateways connected to this Caché instance
1
USER>set mgr = managers.GetAt(1) // I only have one

USER>write mgr.GetThisServerName(.names)
1
USER>zwrite names // this server is listed in CSP Gateway Configuration as 'LOCAL'.
names(0)="LOCAL"
USER>kill params

USER>set params("Username")="CSPSystem"

USER>set params("Password")="very strong password"

USER>write mgr.SetServerParams("LOCAL",.params)
1

USER>write mgr.CloseConnections("LOCAL") // close connections, forcing to reconnect with new credentials.
1

Please be careful, if username/password are not valid for connection to Caché, then CSP Gateway will not be able to reconnect, and you'll loose connection with CSP Gateway and ability to modify settings using this API.

For more details see

  1. https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCGI_registry
  2. Class reference for classes in package %CSP.Mgr
Alexander Koblov · Aug 30, 2018 go to post

Unless you have list with $c(3,1,0) as element

USER>set list = $lb("stri,ng", $c(0), 2, $c(3,1,0), 3)
 
USER>set list = $replace(list, $lb($c(0)), $lb())
 
USER>zw list
list=$c(9,1)_"stri,ng"_$c(1,3,4,2,5,1,1,3,4,3)
 
USER>w $LL(list)
 
W $LL(list)
^
<LIST>
Alexander Koblov · Aug 28, 2018 go to post

I don't know the fastest way. I know a way:

 set list = $lb("stri,ng", $c(0), 2)
 set list2 = "", ptr = 0
 while $listnext(list, ptr, elem) {
	 if elem'=$C(0) {
		 set list2 = list2 _ $LB(elem)
	 } else {
		 set list2 = list2 _ $LB()
	 }
 }
Alexander Koblov · Jul 5, 2018 go to post

Might be that %Development resource has 'Public Permission' -- see Management Portal -> System Administration -> Security -> Resources.

Might be that %Development resource is granted not to user directly, but to web application.

So, I would check that security settings are the same on both 2016.2 and 2017.2 instances

Alexander Koblov · Jul 3, 2018 go to post

This message means, that server-side Atelier API -- web-application /api/atelier -- is configured with only Unauthenticated access. So, even though you put Username/Password in Server connection dialog, they are cannot be used, as server-side configuration does not allow this.

To allow password authentication, open Management Portal, then go to Menu (top-left corner) -> Manage Web Applications -> [api/atelier].

Put checkbox near Password in "Allowed Authentication Methods". Save the web application

Alexander Koblov · Jul 3, 2018 go to post

Dan,

also try to put following lines in /configuration/config.ini

osgi.module.lock.timeout=600
equinox.statechange.timeout=600
Alexander Koblov · Jun 29, 2018 go to post

If you can’t telnet to that server/port from computer with Studio then something in the middle prevents this connection. This is question for network administrators.

Alexander Koblov · Jun 29, 2018 go to post

If Audit is enabled and LoginFailure and Protect events are enabled and there is no audit event recorded when you enter username/password and see error after clicking OK.

then I would say that connection attempt from Studio does not reach HealthShare.

Can you do telnet on port 1972 from the computer where you have Studio? Instead of server specify IP-address of server with HealthShare

C:\temp>telnet server 1972
  Connecting To server...
Alexander Koblov · Jun 29, 2018 go to post

I believe you can click Cancel on that "Communication link failure" error and then go to File -> Change namespace -> Connect -> choose the instance and then Studio will ask you for credentials

Alexander Koblov · Apr 16, 2018 go to post

Nael,

I think you need to use 4th argument of $zconvert:

Set file=##class(%File).%New(..LocalFileName)
Do file.Open("R")
Set handle=""
While 'file.AtEnd { 
    Set Line=$ZCVT(file.Read() , "I", "UTF8", handle)
   // do something with Line
}
Do file.Close()

Handle "contains the remaining portion of string that could not be converted at the end of $ZCONVERT, and supplies this remaining portion to the next invocation of $ZCONVERT."

Please see reference for $zconvert