Alexey Maslov · Feb 23, 2024 go to post

^SPOOL(docIdx) approach allows spooling sharing across ECP network, while ^SPOOL($j) does not :)

%IS is an utility which allows to choose devices by CHUI routines users and %SPOOL utility can manipulate with spool files opened using the %IS utility only.

It seems that initial purpose of spooling facility has gone with such a users and such a printers (strictly character based, w/o ability of font selection, etc), while its usage still can be actual in rather exotic cases like this one.

Alexey Maslov · Feb 22, 2024 go to post

Yeah, but it should be used with precautions. Let's see what happens when two processes access spooling device concurrently: 

USER>f {q:'($zh\1#20)} k a o 2 f i=1:1:10 {s a(i)=i*100} u 2zw a c 2; process #1
USER>s i="" f  {s i=$o(^SPOOL(1,i),1,line) q:i=""w line} ; look inside ^SPOOL(1)...
a(1)=100
a(2)=200
a(3)=300
a(4)=400
a(5)=500
a(6)=600
a(7)=700
a(8)=800
a(9)=900
a(10)=1000
{66892,65205{11
USER>f {q:'($zh\1#20)} k a o 2 f i=1:1:10 {s a(i)=i} u 2zw a c 2; process #2
USER>s i="" f  {s i=$o(^SPOOL(1,i),1,line) q:i=""w line} ; look inside ^SPOOL(1)...
a(1)=100
a(2)=200
a(3)=300
a(4)=400
a(5)=500
a(6)=600
a(7)=700
a(8)=800
a(9)=900
a(10)=1000
{66892,65205{11

As you can notice, one process's output suppressed the other's one. To avoid it, firstly RTFM: OPEN and USE Commands for Spooling Device, and implement some synchronization pattern, e.g. 

USER>f {q:'($zh\1#20)} s docIdx=$i(^SPOOL) k a o 2:(docIdx) f i=1:1:10 {s a(i)=i*100} u 2zw a c 2; process #1
USER>s i="" f  {s i=$o(^SPOOL(docIdx,i),1,line) q:i=""w line}
a(1)=100
a(2)=200
a(3)=300
a(4)=400
a(5)=500
a(6)=600
a(7)=700
a(8)=800
a(9)=900
a(10)=1000
{66892,66645{11{
USER>f {q:'($zh\1#20)} s docIdx=$i(^SPOOL) k a o 2:(docIdx) f i=1:1:10 {s a(i)=i} u 2zw a c 2; process #2
USER>s i="" f  {s i=$o(^SPOOL(docIdx,i),1,line) q:i=""w line}
a(1)=1
a(2)=2
a(3)=3
a(4)=4
a(5)=5
a(6)=6
a(7)=7
a(8)=8
a(9)=9
a(10)=10
{66892,66645{11{

Each process has got it's own output in ^SPOOL(docIdx) now. This approach works if every consumer of spooling facility follows the same pattern; incrementing ^SPOOL is just an easiest approach, while it would be better avoid touching system globals and increment something else according to your taste.

Alexey Maslov · Feb 8, 2024 go to post

The same behavior is with ";" comments. It seems to be a new feature of InterSystems ObjectScriptv2.12.1:
older versions acted similarly with "///" comments only.

I'm not sure that this innovation makes our life worse, while having the way to switch it off would be useful.

Alexey Maslov · Jan 9, 2024 go to post

I'd like to collect tables based on logs

In general, such approach is far from optimal for Caché like databases because logs (which are usually called  "journals" in Caché/M world) are being written on global (= lowest possible) level, disregard of data model used by an app (SQL, Persistent classes, etc). Reconstructing app level data from underlying globals can be a tricky task even for Caché guru.

That was one of the reasons why colleagues of mine took another approach for close to real-time data export from Caché to external system. In a few words, they used triggers to form application level data packets on Caché side and pipe them to the receiver. This approach saved CPU time preventing its waste for filtering out unnecessary journal records and minimized cross-system network traffic.

Alexey Maslov · Dec 18, 2023 go to post

$sequence can leave "holes" in numbering which can be undesirable in some cases, e.g. when meaningful IDs are assigned: it seems to be strange to have APP-DD-99 and APP-DD-101 without APP-DD-100.

Alexey Maslov · Dec 12, 2023 go to post

Setting $ZTZ affects the current job only (the job, which sets $ztz), so there is no danger for other processes

What about REST services or web apps? Isn't there one process possibly serving several clients' requests?

Alexey Maslov · Dec 11, 2023 go to post

Robert, it sounds strange, but... Setting the Time Zone

You can use $ZTIMEZONE to set the time zone used by the current InterSystems IRIS process. Setting $ZTIMEZONE does not change the default InterSystems IRIS time zone or your computer’s time zone setting.

IMHO, $ztimezone setting is dangerous not for its system-wide effect (which it hasn't) but mostly due to its exclusions and anomalies, despite they are accurately listed in docs.

Alexey Maslov · Sep 5, 2023 go to post

Hi Sylvain,

Is it possible to publish more details of the scenario which showed such impressive figures?

Alexey Maslov · Aug 8, 2023 go to post

My #1 choice would be:

  • go to Management Portal -> Globals
  • select globals as needed
  • choose Export, then select browser instead of server
  • then the .gof file will be downloaded to your local filesystem.

Alexey Maslov · Aug 1, 2023 go to post

Both global traverse only 1st level in $order

It seems that you are a bit confused with these levels. Globals are B* trees physically: all subscripts are concatenated into one key, therefore even when you logically traverse only 1st subscript, you traverse all of them physically.

Alexey Maslov · Jul 30, 2023 go to post

my real global has more than 6-8 subscripts and takes 110

What is the result of

write$$AllocatedSize^%GSIZE($name(^RealGlobal))/1024/1024

a similar global with 6-8 subscripts ... and takes only 15 to 16 seconds

What is the result of

write$$AllocatedSize^%GSIZE($name(^SimilarGlobal))/1024/1024
Alexey Maslov · May 26, 2023 go to post

My question became a subject for investigation by WRC; let us wait for the results.

Alexey Maslov · May 25, 2023 go to post

Meanwhile, such "numbers" are still evaluated as invalid ones:

QMS>w$isvalidnum(txt)
0

Therefore, why the expression " if ("_txt_")" is evaluated as a valid one?
Not to mention that an attempt to execute it provides usual <MAXNUMBER> error.

Alexey Maslov · May 18, 2023 go to post

the first letter becomes the last letter, the second letter becomes the second-to-last letter, and so on

This definition means string reverse rather than rotation, while you apparently meant right (or clockwise) string rotation which is:
1st character becomes the 2nd, last ones becomes the 1st, repeat until the first string will become equal to the second string. As to your sample:
hello -> ohell -> lohel -> llohe

Alexey Maslov · May 11, 2023 go to post

Done, expecting that InterSystems ObjectScript was the right choice for the kind of issue.

Alexey Maslov · May 11, 2023 go to post

VS Code is great for development, while InterSystems extensions behavior is disappointing sometimes.

E.g., since some update was installed, <Ctrl/Mouse pointer> stopped referencing the methods of another class. <Right button menu -> Goto Definition> stopped working as well. Is it a bug or a feature?

Alexey Maslov · May 4, 2023 go to post

Establishing of source control based development technology needs some efforts, while gives much more advantages. It's possible even with Studio, while easier with VS Code.
Besides, when each developer has its "own" methods it would be easier to resolve possible merge conflicts.

Alexey Maslov · Apr 28, 2023 go to post

Thank you.
In Caché 5.0 and earlier versions there were no web portal at all; those version were supplied with so called GUI Utilities: System Explorer, Configuration Editor and so on.
System Management Portal appeared in Caché 5.1, and many people still call it by its initial name often abbreviating it to SMP.

Alexey Maslov · Apr 28, 2023 go to post

Hi Hiroshi,
Can you explain the difference between "Management Portal" and "System Management Portal"?

Alexey Maslov · Apr 26, 2023 go to post

Hi Luis,
Thank you for the article.
Did I understand right that its main purpose was to introduce the mirror concepts to novices? If so, it's great, while in real life: if the host goes down, all three containers would go down.

Alexey Maslov · Apr 12, 2023 go to post

Chad, thank you for complete explanation of available options. As to you questions:

1. We have a TASKMGR task which calculates the size of each global in all databases. It's usually scheduled by our customers for daily run.
2. The main purpose of collecting such info is the ability to quickly answer the questions like this: "why my database is growing so fast?". Integrity Check is not used for the similar purpose because it can't be scheduled for daily run due to its relative slowness in our versions of Cache and IRIS.

Alexey Maslov · Mar 22, 2023 go to post

I should check docs before any "quick testing": only terminal (TRM:), telnet and file current devices can provide $ZIO with non-empty values. No client/server!

Alexey Maslov · Mar 22, 2023 go to post

Hiroshi,
May I ask you where did it ever work?

Here are the results of quick test in Studio Output window: 

w"*"_$zio_"*"
**
w"*"_$zutil(67,12,$j)_"*"
*MYPC*
w##CLASS(%SYS.ProcessQuery).Open("P"_$j).ClientNodeName ; prefered (documented) way
MYPC
w##CLASS(%SYS.ProcessQuery).Open("P"_$j).ClientIPAddress
10.8.3.37

Alternative program which supports CacheActiveX connection showed the same results, by the way, regardless of server's platformwhether it was UNIX/Linux or Windows.

IRIS for Windows (x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:39:22 EDT

while results were similar in all previous Cache/IRIS versions I managed to run.