Alexander Koblov · Jul 2, 2019 go to post

Thank you Alexey. Yes, you are correct, second statement is correct. I've asked to modify first statement.

Alexander Koblov · Jul 1, 2019 go to post

Hi Fab!

Changes to globals mapped to non-journaled databases are still journaled inside transactions. Unless globals are mapped to IRISTEMP or journaling is completely stopped at the system.

Quoting the docs: "While updates to non-journaled databases that are part of transactions are journaled, these journal records are used only to roll back transactions during normal operation. These journal records do not provide a means to roll back transactions at startup, nor can they be used to recover data at startup or following a backup restore."

https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GCDI_journal#GCDI_journal_disabling

Alexander Koblov · Jun 27, 2019 go to post

Hi Nael

Not possible, as far as I know.

You can play with $stack. Something like this:

 set Result=$$MyFunc(1,.Out)
 quit
MyFunc(Param1,Param2)
 write $stack($stack-1,"MCODE"),!
 set Param2="it's all good"
 quit 1

USER>d ^test
 set Result=$$MyFunc(1,.Out)

But here you are looking at parsing plain strings, and this is error-prone.

Alexander Koblov · Jun 17, 2019 go to post

You should use Locate:

Set tRegEx = "<[^>]*>"
Set htmlSnippet = "<h1>Hello1</h1><h1>Hello2</h1>"
Set regex=##class(%Regex.Matcher).%New(tRegEx)
set regex.Text = htmlSnippet
while regex.Locate() {
	write "Found ",regex.Group," at position ",regex.Start,!
}     

Also it's not possible to parse generic HTML with regular expressions (https://stackoverflow.com/a/1732454/82675). Limited subset of HTML -- maybe.

Alexander Koblov · Jun 13, 2019 go to post

Reason for "0.001005933" being string is not that it is less than 1, but that it's not in a canonical form.

That is -- it has integer zero before decimal point.

Put '+' before expression:

USER>Set MsgDT = "20180405000000001005933"
 
USER>Set MsgDTH = + $ZTH(($E(MsgDT,9,10)_":"_$E(MsgDT,11,12)_":"_$E(MsgDT,13,14)_"."_$E(MsgDT,15,23)),1)
 
USER>write 
 
MsgDT=20180405000000001005933
MsgDTH=.001005933
Alexander Koblov · May 23, 2019 go to post

Both Caché and InterSystems IRIS support ODBC. So you can connect to them from PHP via ODBC.

Alexander Koblov · Apr 12, 2019 go to post

Jimmy, what version do you use? Try to upgrade to latest available version -- 2018.1.2 for Caché, perhaps this error is fixed there.

Alexander Koblov · Apr 4, 2019 go to post

David,

can you please provide provide SQL generated by the Entity Framework that is not valid and error that is generated.

Alexander Koblov · Apr 4, 2019 go to post

Lucas,

Log that you provided spans from March 19th 09:35 to March 20th 14:43.

Depending on moments when application was unavailable you need to look in different records of csp.log

For example,

  1. Exception caught in f:csp: c0000005:4600 c0000005 is the code for an access violation.

I would advise to you to try installing latest release version of CSP Gateway, or if this error still appears there, contact InterSystems Worldwide Response Center to fix this error.

  1. CSP application closed the connection before sending a complete response

This is most likely something with the code of the page "/csp/erp/system/lib/filtro.csp". It started to write some answer back and then closed the connection, for example process terminated itself with halt

  1. Configuration Error: Insufficient space in the configuration buffer Configuration block Size: 126397; Size of configuration block to insert: 55114; Space available: 68611 (Consider setting CONFIG_BUFFER_SIZE=112K (or higher) in the [SYSTEM] section of CSP.ini)

This message is self-explanatory

  1. Failed to connect to 'csp' - Reason: -8 (Server busy: Gateway's configured limits exceeded) (No Retry)

CSP Gateway can limit number of total connections to server and connections per session that it makes to Caché. See parameters "Maximum Server Connections" and "Maximum Connections per Session" here.

Generally for IIS-specifics read section "Microsoft IIS All Versions" of CSP Gateway configuration guide. And for general configuration of CSP Gateway -- chapter "CSP Gateway Operation and Configuration".

Alexander Koblov · Mar 1, 2019 go to post

No, indirection does not introduce additional stack, as far as I know. It works with variables that are visible in public (global) scope, not in private scope of procedure.

Alexander Koblov · Feb 28, 2019 go to post

Quoting doc: "Name indirection, argument indirection, and XECUTE commands that appear within a procedure are not executed within the scope of the procedure."

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

Consider method:

Class Test.test [ Abstract ]
{

ClassMethod ind()
{
	kill info

	set active = 1
	set i="active"
	set @i = "global scope"
	break
}

}

Output:

USER>do ##class(Test.test).ind()
 
 break }
 ^
<BREAK>zind+5^Test.test.1
USER 2d1>w
 
active="global scope"
<Private variables>
active=1
i="active"

Notice private variables and public variables.

Alexander Koblov · Jan 26, 2019 go to post

Null in this case is not a reserved word. It’s just a name of variable that is not defined.

Alexander Koblov · Dec 10, 2018 go to post

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?

Alexander Koblov · Nov 20, 2018 go to post

while this test is indeed fun, the most important phrase in your post is of course:

best stay away from doing anything too clever as it leads to unreadable code

Alexander Koblov · Nov 16, 2018 go to post

Hm, I thought that length of values would also have impact, but provided how globals are stored maybe this does not matter.

Also I wonder if blocksize matters.

Alexander Koblov · Nov 16, 2018 go to post

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.

Alexander Koblov · Nov 16, 2018 go to post

No, Ed indeed means number of unique values for indexed column.

E.g. our docs advises no more than 10'000-20'000 distinct values for bitmap indices.