Article
· Nov 11, 2019 11m read
Transactions in Global InterSystems IRIS

InterSystems IRIS supports a unique data structure, called globals, for information storage. Essentially, globals are persistent arrays with multi-level indices, having several extra capabilities—transactions, quick traversal of tree structures, and a programming language known as ObjectScript.

I'd note that for the remainder of the article, or at least the code samples, we'll assume you have familiarised yourself with the basics of globals:

6 7
1 805

Hi all,

I am trying to create a method to count the number of entries in a global, including all subscripts. I am having a bit of trouble getting the code to make it to the second subscript. When I get to the position where my key is "Canada" and I add a comma and empty quotes to it, it returns USA as the new key when I do the order function. Is the $Order or the global not able to use a single string to represent multiple subscripts?

Here is my global structure:

2 20
0 595
Announcement
· Aug 23, 2019
New Video: Globals Quickstart

Hi Community!

Enjoy watching the new video on InterSystems Developers YouTube, recorded by @Joel Solon, InterSystems Senior Technical Trainer:

Globals Quickstart

https://www.youtube.com/embed/jJifoZq2bW0
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

2 0
0 478

Hi Developers!

InterSystems IRIS stores everything in globals and if we use ObjectScript classes to persist data class documents globals it uses in storage. But if you use globals for calculations, temporary storages, for special indexes or for some other purposes - how do you document it?

Possible options which come to my mind:

1. Macro

#define Array ^MyGlobal

usage:

s $$$Array(1)=1

2. Class parameter

Parameter Array ="^MyGlobal";

Usage:

0 3
0 322

I need to copy a bunch of globals from some crufty old databases to spanking clean brand new ones. GBLOCKCOPY has this cool feature that lets you create a batch of global names to copy and save the list in a batch. You can then execute the batch and go take a nap.

I like naps.

I need to do this for a number of old-new database pairs, but it's the same global names every time. Is there a way to export the batch configuration created the first time and import it to another environment/namespace? These databases will be spread across multiple hosts.

Thanks!

0 2
0 278

Hi Community!

Please welcome a new video on InterSystems YouTube Channel:

InterSystems and Python QuickStart

https://www.youtube.com/embed/HYc5wQ0uURg
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

2 0
1 486

In the previous parts (1, 2) we talked about globals as trees. In this article, we will look at them as sparse arrays.

A sparse array - is a type of array where most values assume an identical value.

In practice, you will often see sparse arrays so huge that there is no point in occupying memory with identical elements. Therefore, it makes sense to organize sparse arrays in such a way that memory is not wasted on storing duplicate values.

In some programming languages, sparse arrays are part of the language - for example, in J, MATLAB. In other languages, there are special libraries that let you use them. For C++, those would be Eigen and the like.

Globals are good candidates for implementing sparse arrays for the following reasons:

8 3
1 1.3K

Sometimes global mapping of the same globals can be defined in different ways. E.g., I need to define it for 3 globals ^qAuditC, ^qAuditLog, ^qAuditLogC from the same database named APP-NOJOURN. Which approach should be better from the performance point of view?

1) qAudit* => APP-NOJOURN (one record in global mapping table)
or

2) qAuditC => APP-NOJOURN
qAuditLog => APP-NOJOURN
qAuditLogC => APP-NOJOURN (three records in global mapping table)

0 3
0 546

Suppose we need to store millions of values temporarily, that means, we don't care about them if we lose them but our application use them to get realtime information. Should I use Cachetemp or whatever other DB without journaling enabled? If answer is Cachetemp, shouldn't be a problem if we decide to scale using App Server + ECP? I'm not sure what would happen with the app logic in such architecture as I guess I couldn't map and share cachetemp...

Any idea/suggestion?

0 5
0 849
Article
· Nov 23, 2017 12m read
Where is my global stored?

It's well-known that namespace global mapping helps us to write code independent on database storage details (Caché instance name, directory path). But sometimes we can face problems accessing an unsubscripted global which has subscript level mapping (SLM) defined. Most of such cases are evident and associated with administrative tasks that should be done on database level, but some of them can confuse even an experienced developer. Just to start:

4 8
0 1.3K
Question
· Sep 13, 2018
Purge Task History manually

Hi,

I've read into console.log that there is some problems writing the global Task History

09/13/18-09:33:00:109 (9052) 0 Error al escribir en global de historial de tareas - Error (ERROR #5002: Error de cache: <DATABASE>%SaveData+20^%SYS.Task.History.1 ^SYS("Task","HistoryD",66179),c:\intersystems\healthshare\mgr\)

1 2
0 380

Hi,

I wonder if you could help me with a problem with persistent globals and journals.

We have a few interfaces using a persistent global just to translate some codes. The use of that global is like a lookup table...an interface calls a method that search for a field (in the message) in the global. If found, the code is translated with another field from the global.

The format of the global is something like:

0 6
0 557

Hi! I have a local project written on Cache and Atelier on my PC. I need to move it to notebook. Tried to export globals, classes, MAC-programms and csp with frontend stuff, but after I created my apps on notebook and imported my set, it just didn't work. I think it's because I have some settings on Management Portal, so how can I export portal settings and what I should export to have my working apps on another computer?

0 3
0 308

I have a simple app which tries to establish a connection with a Cache database instance via Global API for Java:

import com.intersys.globals.Connection;
import com.intersys.globals.ConnectionContext;

public class Assignment {

    public static void main(String[] args) {
        Connection connection = ConnectionContext.getConnection();
        connection.connect("SAMPLES", "_SYSTEM", "SYS");
    }

}

The expection I am getting:

0 36
0 777