Hans-Peter Iten · Nov 2, 2022 go to post

I think this has something to do with ECP timeout. Please start management portal and check System -> Configuration -> ECP settings.
Default timeout = 1200 seconds (maybe you'll find there a value of 600).

Hans-Peter Iten · Jun 9, 2022 go to post

"Unfortunately" ECP is the only method to connect remote databases. Maybe it's a license-server-problem. Could you please check that both instances are using the same license server?

Let's say, both systems are placed in a domain jetsons.com. There are two systems each of them has a Caché-instance running. System-1 is called betty and system-2 called wilma. 

So we have:
System1: betty.jetsons.com / Caché-Instance = barney
System2: wilma.jetsons.com / Caché-Instance = fred

System1: License-Port = 4001 (you may use another port instead of default), License-Server = betty.jetsons.com
System2: Same licensing-information as on System1 (betty.jetsons.com:4001 (or another port you defined there)

After doing so, restart both instances and check cconsole.log if license server was started on both systems.

And if that doesn't help then you should contact WRC.

Please keep in mind that the service ECP (Administration -> Security -> Services) must be running.

Maybe you need an upgrade of the license. I remember that we had to do it when we installed a newer version. To do so you also have to contact Intersystems-WRC

Hope, that will help you :-)

Hans-Peter Iten · Jun 8, 2022 go to post

Does the other instance use the same license? All instances must use the multi server option

Hans-Peter Iten · Apr 5, 2022 go to post

Do you mean this?:

S sub1=111,sub2=444
S TAB(""_sub1_""","""_""_sub2_"")=""

zw TAB
TAB("111"",""444")=""
 

Hans-Peter Iten · Mar 28, 2022 go to post

Another possibility to get freespace is to compact the database:

%SYS> Do ^DATABASE -> Compact globals in a database

Hans-Peter Iten · Mar 14, 2022 go to post

You could also use the class  %SYS.Journal.File

Example:
Set JournalFile = ##class(%SYS.Journal.File).%OpenId(EXISTING_JOURNAL_FILE)
Set JournalRecord = JournalFile.FirstRecordGet()
While (JournalRecord '= "") {
  Here you can program your search criteria example:
  If JournalRecord.%IsA("%SYS.Journal.SetKillRecord") {
   insert your code
}
}

Check documentation for further hints.
 

Hans-Peter Iten · Nov 29, 2021 go to post

The documentation might be a little bit long, so I try to make it short. If you write down some kind of logic in COS and save it, then you'll get a routine. The easiest  way to create a routine is this, using a terminal session: ZR<ret><tab>WRITE $H<ret>ZS<space>MYROUTINE. (<this are the corresponding control characters>)Doing so, you'll get an INT file called MYROUTINE.INT. You can see it using %RD in a terminal session in the namespace where you saved the routine. You can run it using the command DO ^MYROUTINE or GO ^MYROUTINE

A routine may contain some labels (some name ended with a TAB) which you can use as functions or procedures. A routine is comparable with a class but you can't instanciate a routine like you can do with a class and it does not contain methods or classmethods.

Global is an array stored on disk. It is a nice datastructure to save your data. A routine can write, store or delete some data stored in Global.

Hope this helps to make the things clear to you

Hans-Peter Iten · Nov 17, 2021 go to post

Did you check if checkbox named 'Enable long strings' is enabled (checked)? (ManagementPoral -> Configuration -> Memory and startup)?

Hans-Peter Iten · Dec 24, 2020 go to post

Before switching to Windows Server 2019 we also used Bitvise. Fortunately Windows Server 2019 comes with OpenSSH (it can be installed as a windows feature). OpenSSH works pretty good and so we don't have to pay for the Bitvise license any longer.

Hans-Peter Iten · Oct 20, 2020 go to post

Hello Paras,

you can't modify $ZIO. When you create a file ABC_1.txt, $ZIO points to this file. When you create a file ABC_2.txt then $ZIO points to this file. Because Unix doesn't know version numbers, you must implement your own file version counter into your  library.
We were confronted with the same problem. We solved it by checking the existing files (doing a directory listing into a local array) estimate the highest version number and incremented 1 to that number. After getting the latest file version number we create the filename. We wrote a wrapper around the class %Library.File.

I know, that it is not perfect to browse the current directory to find all files and extract the version number out of a part of the filename. But I didn't find a better solution.

Best regards
Hans-Peter

Hans-Peter Iten · Oct 19, 2020 go to post

Hello Paras,

to understand the way Caché distinguishes between the files, you can use the special variable $ZIO. This returns the full filename.

Example: SET FILE="ABC.TXT" O FILE:"N" USE FILE SET FULLFILE=$ZIO USE $PRINCIPAL WRITE $ZIO
If you run this example in two separate terminal sessions then you see, that the version number is incremented. When you do this in the same terminal session and don't close the file then the version number is NOT incremented. The fileversion will be incremented, when the file has been closed (... USE FILE SET FULLFILE=$ZIO CLOSE FILE OPEN FILE:"N" USE FILE SET FULLFILE=$ZIO...).
When you check the content of FULLFILE you'll find the full filename including the version number.

When another process does the same, another file handle is created and if you check $ZIO then you'll see, that this process is using another file version.

Hans-Peter Iten · Sep 14, 2020 go to post

At first sight it might be very cool to have code for methods in a few  lines. It is the way of programming we had in the past times. I can't recommend to use this way of coding, because it makes it very hard to read and understand the logic of code. I grew up with this kind of coding so I am very familiar with this but I am happy that Caché gives me the way to code in a modern style. When I look into my old programs, which consist of this kind of coding, then I always feel to read ugly code. I would like to change it immediately. Forget it to compact the code in one line. Put it into more lines and avoid postconditionals. If-statements are more readable and you don't have to think about what the code will do.

Nice satiric article smiley

Hans-Peter Iten · Jun 24, 2020 go to post

It is not normal, that the port is changing. Caché database uses port 1972 as default for connections. It remains number 1972 until you change it in the configuration.  If there are changes in the port number then you should first find out where the reason for the changes comes from. Maybe there are some hints in cconsole.log.

Hans-Peter Iten · Apr 6, 2020 go to post

You can call methods from command line even like you call routines. Imagine you have a class Test in package TestClasses and a method printData which prints the data to your output device. Then you can call csession instance -"U" namespace "##class(Test).printData("""data""")".

Of course the methods must be ClassMethods. You must test the number of " - signs.  In PowerShell for instance I needed around 14(! sic) "-signs to send a valid command to Caché.

Here the example:

csession ${INSTANCE} -"U" ${NAMESPACE}  "##class(TestClasses.Test).printData(""""""""""""""hello"""""""""""""")"

hello

Hans-Peter Iten · Feb 20, 2020 go to post

If ctrl+c doesn't work, then you can terminate the session using the program JOBEXAM and terminate the job which uses %SYSMONMGR. To do so just open another terminal window.

Hans-Peter Iten · Feb 14, 2019 go to post

I solved this problem myself:

Suppose you switched (cd) into bin-directory of caché installation:

PS> .\csession myCache -U myNamespace "##class(test.OsCall).inString(""""""""""""""$string"""""""""""""")"

$string contains some text

Hans-Peter Iten · Feb 14, 2019 go to post

How would you do that with PowerShell?:

PS C:\InterSystems\Cache\bin> .\csession mycache -"U" user "##class(test.OsCall).inString(""""""abd"""""")"

<INVALID ARGUMENT>>
PS C:\InterSystems\Cache\bin>

Combination of escape-characters doesn't work like these "##class.....(\`"abd\`")" or "##class....(`"abd`")"

compared to CMD:

C:\Users\me> .\csession myCache -"U" user "##class(test.OsCall).inString(""""""abd"""""")"  //see Seans good answer


Argument read: abd  (this comes from my Caché-class, so this environment works properly)

Hans-Peter Iten · Dec 17, 2018 go to post

Checking documentation for class %Net.Remote.Utility I find out that it is provided for internal use for Intersystems. So may I use this class in my personal routines without getting any bad surprise?

Hans-Peter Iten · Oct 24, 2018 go to post

Instead of using $ZSEARCH you can use the query FileSet in class %File:

ClassMethod getFiles(pDir As %String, pMask As %String)
{
   set dir=##class(%File).NormalizeDirectory(pDir)
   set result=##class(%ResultSet).%New("%File:FileSet")
   do result.Execute(dir,pMask)
   while result.Next() {
      write !,result.GetDataByName("Name")
   }
}

Hans-Peter Iten · Nov 17, 2016 go to post

You can do this using Caché Object Script:

S DBDIR="directory_of_database"
S DBOBJ=##class(SYS.Database).%OpenId(DBDIR)
S DBOBJ.ReadOnly=0  //switch to read/write mode
S STA=DBOBJ.%Save()

S DBOBJ.ReadOnly=1  //switch to read only mode
S STA=DBOBJ.%Save()