I'm getting following error, running your program on Caché 2017.2.2:

USER>do ^test
This FTP server is anonymous only.

And it works OK once I change Connect to be anonymous:

If 'ftp.Connect(host,"anonymous","",port) Write ftp.ReturnMessage,! Quit sc

Output:

USER>do ^test
Ftp server messsage:
Features:
 EPRT
 EPSV
 MDTM
 PASV
 REST STREAM
 SIZE
 TVFS
End
Mode now: Binary
Length of file received: 524288

Can you connect to speedtest.tele2.net from the same server, but not from Caché? Maybe access via port 21 is blocked by your firewall?

I think I would run tests and publish the results.

I think this test proves nothing.

Interesting to know underlying reasoning of saying: "Use bitmap index if there are less than X distinct values in common" or "Use bitmap index if selectivity of column is less than Y".

Why X, why Y? Where is this 6400 and 2% come from? What is it in bitmap indices that makes them slower, once these thresholds are reached?

There are two many variables to take into account in this test, so it's much more interesting to see formula than test results.

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"

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.

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.