Timo Lindenschmid · Nov 8, 2024 go to post

The beauty of the IRIS technology stack is that code and data is withing the same instance.

To separate code from data ISC uses the idea of code and data databases, which can be configured on a namespace level, this combined with global, package and routine mappings results in very versatile environment that should satisfy every need. If you want to actually separate compute from data storage, this is also possiple using the ECP protocol with dedicated app servers. 

Timo Lindenschmid · Oct 29, 2024 go to post

Hi Enrico, my sample code does that exactly. It takes number1 and converts it to a number than it compares the result to the original number1 field. 
Quirk of type conversion in ObjectScript if a value is converted from string to number ObjectScript walks the values from left to right and stops at the first non numeric character ie.
123ABC   becomes 123
The if clause checks then if 123 = 123ABC so the org value is non numeric.
Using && in the IF clause means do a logical AND check but short circuit the check ie. if condition 1 is already false go directly to the else clause and do not check cond2 and3

Timo Lindenschmid · Oct 28, 2024 go to post

pure objectscript way no functions needed, we just use the IRIS type conversion behavior:
 

set number1="123123"set number3="123123123 Not a pure number"if ((+number1=number1) && (+number2=number2) && (number1>=number2)) {
    set div=number1-number2
} else {
    w !,"Conditions not met"
}
Timo Lindenschmid · Oct 23, 2024 go to post

A simple health probe would be to have the LB poll /csp/mirror_status.cxw on the respective webserver it will return success if this webserver is connected to the active mirror and failed if its connected to the backup mirror.

Timo Lindenschmid · Oct 23, 2024 go to post

Hi Fred,

on the AWS instance what does the command "iris list" return?
Also you can have a look at the messages.log file located at the <installDir>/mgr/messages.log

This should give you an idea of what the issue is.

Timo Lindenschmid · Oct 23, 2024 go to post

Hi, without knowing a bit more about what you are trying to achieve its difficult to advise.

To export and reinstate a data structure including content you would need to export the storage class definition.

After that you then can export the Global data and index storage defined by the storage class.
To export you can use $system.OBJ.Export from a terminal/iris session. Then reimport using $system.OBJ.Load

Timo Lindenschmid · Oct 22, 2024 go to post

Have you tried deleting the task using d ^TASKMGR ? This routine is available in the %SYS namespace, and you should login to terminal/session with a user that has %All access rights.

Timo Lindenschmid · Oct 16, 2024 go to post

Hi Marykutty,

depending on your use case. Usually, I would suggest going with Primary and BACKUP mirror plus arbiter for the optimal HA resilience. A webgateway on a dedicated IIS can serve both your application and the SMP. I usually would though consider having 2 webservers running so your single webserver is not the single point of failure.
Also just to be aware webgateway is mirror aware and does not need a VIP to automatic redirect connections to the correct mirror. (refer documentation on mirroring )

Timo Lindenschmid · Oct 10, 2024 go to post

very quick and dirty test, probably only works on small streams, also needs to actually read the whole stream for compare.
 

# test compare - streams are same
set stream1=##class(%Stream.TmpCharacter).%New()
set stream2=##class(%Stream.TmpCharacter).%New()
do stream1.WriteLine("ABC123")
do stream2.WriteLine("ABC123")
do stream1.Rewind()
do stream2.Rewind()
w (stream1.Read() = stream2.Read())

1

# test compare - stream are different
set stream1=##class(%Stream.TmpCharacter).%New()
set stream2=##class(%Stream.TmpCharacter).%New()
do stream1.WriteLine("ABC123")
do stream2.WriteLine("DEF456")
do stream1.Rewind()
do stream2.Rewind()
w (stream1.Read() = stream2.Read())

0
Timo Lindenschmid · Sep 19, 2024 go to post

Completely silent install an application can only happen during IRIS upgrade/install or by being creative with scheduled tasks.

First step would be to automate installation of you application using a %Installer script refer to Documentation

Fully automating it could involve a scheduled task checking a folder on the filesystem for the installer manifest and importing it.

Timo Lindenschmid · Sep 2, 2024 go to post

Hi Scott,

my first thought here was use ^GBLOCKCOPY.

GBLOCKCOPY can copy all globals from one database into a new database or namespace.
So in your case create a new namespace with the correct mappings and new default databases. then use ^GBLOCKCOPY to copy all globals into this namespace. The copy to namespace follows the mapping definition for the namespace and should split Global(data) and Routine(also in globals) into the respective default databases.
This new databases can also created mirrored and then would be populated on all nodes respectively.

A caveat though i would test this first as i am a bit unsure if it really gets all globals located in a database(including system), although i am pretty sure it does.

Timo Lindenschmid · Aug 30, 2024 go to post

Hi Richard,

at the version of Cache you are using there is no terminal via web browser. Not even sure if the community webterminal is working with this old version of Cache.

Only recent IRIS versions have introduced a terminal service via web technologies to be used with VSCode.

Timo Lindenschmid · Aug 30, 2024 go to post

This sounds very strange. Have you tried using a linked table instead of an external table? 

Might be worth raising this with WRC as External tables is a new feature with IRIS 24.2

Timo Lindenschmid · Aug 26, 2024 go to post

Hi,

so just to summarize what i understood. 

You have a superclass with some logging method. Now every time the logging method is called from a child class it logs the name of the superclass instead of the Child class?

If so the issue is that $CLASSNAME returns the name of the class where the method is located not where a method is called from.

To work around this behaviour you would need to rewrite your logging method to be a codegenerator, e.g.

instead of:

ClassMethod Log()
{
    w$CLASSNAME()
}

rewrite it like this:
 

ClassMethod Log() [ codemode = generator, forcegenerate ]
{
    do%code.WriteLine("    w $CLASSNAME()")
    quit1
}

This will locate the Log method from the superclass to the child class and have $CLASSNAME resolve to the child classname.

Timo Lindenschmid · Aug 22, 2024 go to post

Ther eis one inherent flaw i found when using linux service definitions. If you once stop/start IRIS using iris stop/start command it breaks the automated shutdown.

To work around this we usually define 2 service definition, one for normal control and one to ensure the instance goes down during shutdown.

example definitions:
 

    [Unit]

    Description=Shutdown management for ISC IRIS Instance SAMPLEINST - to ensure DB instance is properly shutdown on system reboot

    [Service]

    Type=oneshot

    RemainAfterExit=true

    ExecStart=/bin/true

    ExecStop=/usr/bin/iris  stop SAMPLEINST quietly

    [Install]

    WantedBy=multi-user.target

    # normal management

    [Unit]

    Description=Management for ISC IRIS Instance SAMPLEINST

    [Service]

    Type=oneshot

    RemainAfterExit=true

    ExecStart=/usr/bin/iris start SAMPLEINST quietly

    ExecReload=/usr/bin/iris   stop SAMPLEINST quietly restart

    ExecStop=/usr/bin/iris   stop SAMPLEINST quietly

    [Install]

    WantedBy=multi-user.target

    Alias=IRIS-iSAMPLEINST.service

Timo Lindenschmid · Aug 22, 2024 go to post

Hi Ron, pretty sure this version is no longer publicly available.
Try contacting WRC if you need that exact version.

I hope you still got your license key saved somewhere.

Timo Lindenschmid · Aug 15, 2024 go to post

Hi Luis,

just looking at documentation try disabling: Do Not Use Delimited Identifiers by Default
 

snip from documentation (ref: documentation:

Do Not Use Delimited Identifiers by Default

The Do not use delimited identifiers by default option controls the format of identifiers in the generated routines.

Select this check box if you are using a database that does not support delimited SQL identifiers. This currently includes the following databases:

  • Sybase
  • Informix
  • MS SQL Server

Clear the check box if you are using any other database. All SQL identifiers will be delimited.

Timo Lindenschmid · Jul 19, 2024 go to post

Have you checked if the /api endpoints are enabled in webapplication?
Also have a look and check Security/Audit/View AuditDB for any errors. Same for ApacheLogs, webgateway logs(CSP.log) as well as the messages.log

Timo Lindenschmid · Jul 18, 2024 go to post

nice, another option here is to create a scheduled task in IRIS to call this, set the task to be called OnDemand and voila you can trigger a shutdown from SMP.

Timo Lindenschmid · Jun 19, 2024 go to post

Hi Philip,

not knowing anything about your deployment or applications hosted by IRIS this will be only very high-level.

There are multiple ways how this can be achieved. 

Essentially the easiest way is to stop/freeze the IRIS instance on your backup mirror in LIVE then, depending on your databse sizes. Either copy the database files over to your test environment, or take afilesystem snapshot and transfer that accross. After start,thaw the backup mirror iris instance.

On the test environment break the mirror. shutdown the instance on your primary test mirror. copy in the databases you transferred (ensure the global mappings are the same), you can choose at this point to not overwrite certain databases you do not want to be refreshed e.g. localsysconfig. start up the iris instance, remove the mirror flag from the database files you just refreshed and then do all post refresh activities. at the end you have to rebuild the TEST mirror though, as per IRIS doco. 

Timo Lindenschmid · Jun 16, 2024 go to post

If you want to secure your web application, rest/soap api's and SMP then you need to do this in IIS/Apache.

Also if you plan to do this work, it would also be a good idea to disable PWS (private web server) and configure the ports served by PWS also to be served by IIS?Apache.

Timo Lindenschmid · Jun 12, 2024 go to post

When you do Delegated Auth you add code to ZAUTHENTICATE that validates the request against what you want e.g. you grab userid from the incoming web session, or even content of the get parameters provided and validate it against a global that was mapped via ECP from your primary server, that global could save e.g. client ip and username.
Then you can assign a valid user in ZAUTHENTICATE for the incoming connection, no password needed.

Timo Lindenschmid · Jun 11, 2024 go to post

I don't think you can provide object script code via the UI for security reasons.

What you probably need to do is open you production item in Studio/VSCode.

Then overwrite the OnInit() method with something like

Below code is not validated and will not be 100% correct in regard to function specs etc, this is only used for clarification and example:

Method OnInit(.............) as%Status
{
    set..IpAddress=$get(^ehrIP)
    set status=#super()
    return status
}
Timo Lindenschmid · Jun 10, 2024 go to post

Hi Carl,

easiest way is to save the authorization to a global, have that global mapped via ECP to your child servers.
On the child servers create a ZAUTHENTICATE routine and implement delegated authentication. essentially you use this routine to check on connection open on the child server if the incoming connection is a valid request based on the auth global mapped from your primary server, then allow or deny.

Timo Lindenschmid · Jun 4, 2024 go to post

The better approach here, if you don't want to use SystemDefaults.

Is to add a global mapping for your global config variable ^ehrIP to the %ALL namespace pointing it to a config database. This will point the ^ehrIP global in each namespace to the same storage location.

Then you can access this global via ^ehrIP as usual. I would not use % globals as they are saved in the %SYS namespace and application code/data should not be living in the %SYS namespace.