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?

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...

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.

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".

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...
2. Class reference for classes in package %CSP.Mgr

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