#Caché

1 Follower · 4.5K Posts

  

InterSystems Caché is a multi-model DBMS and application server. See more details here.

Documentation.

Question Eduard Lebedyuk · Dec 2, 2018

I'm using this code to read a file, line by line.
Most lines are shorter than 32767 symbols, but some are longer. No line is longer than $$$MaxStringLength and long strings are enabled.
Is there a param to Open/Read command I can pass to increase Read limit?
My code:

set filename = pFile
open filename:("R")
for  {
    use filename read x
    quit:$ZEOF=-1
    set ^dbg($i(^dbg)) = $lb($e(x,1,10), $e(x,*-10,*), $l(x))
}
close filename

I've checked reclen parameter but it did not seem to help
 

3
0 322
Question Anthony Harrison · Nov 9, 2018

We are trying to get a custom header that I have added to a request to Cache, and I have seen the following in another post, however it doesn't work for us:

You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request

And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_

So, you may try this code.

set ipCountry=%request.GetCgiEnv("HTTP_CF_IPCOUNTRY")

I have verified in Charles (a Mac equivalent to the Windows traffic sniffer 'Fiddler' program) that my client sent the following headers in the request to Cache:

4
0 1472
Question Jiri Svoboda · Nov 9, 2018

Hi all,

I have an incoming JSON message with a string field exceeding in length the 'caché long-string limit' of 3641144 characters.

Using {}.%FromJSON(instream) I am able to create %DynamicObject properly. However, I am unable to access the long property, as in every assignment, I get the <MAXSTRING> error.

Is there any way for me to obtain contents of the 'too long' string field as a stream?

Thanks

Jiri

3
0 12501
Question Andrew Hubbard · Nov 19, 2018

When using the JSON_OBJECT() function in Caché SQL on a %String property that contains JSON syntax, it converts the %String into a JSON object instead of escaping it as a string literal. How can I prevent this? (without ridiculous hacks like "add a space to the beginning of the value" as we don't always know which properties will contain these values and I certainly don't want to have to check for nulls and add/remove a space every single place this value is used in the application)

I don't want these strings automatically marshalled into JSON objects.

For example:

12
0 1371
Question Rui Figueiredo · Nov 25, 2018

Hi,

I'm having the following error when returning a large dataset from a REST API.

"errors":[ {
            "code":5002,
            "domain":"%ObjectErrors",
            "error":"ERROR #5002: Cache error: <STORE>%0NmGk1+5^xxxxxx",
            "id":"CacheError",
            "params":["<STORE>%0NmGk1+5^xxxxxxxxxxxxxxxxxxxx"
            ]
        }
    ],
    "summary":"ERROR #5002: Cache error: <STORE>%0NmGk1+5^xxxxxxxxxxx"

My understanding is that this error is related to the amount of memory available. 

1
0 4985
Question Jack Mears · Nov 26, 2018

As part of a BPL I am building I need to foreach over a some repeating elements and look for a certain value, if said value is present I need to forward the message to another operation. 

I can't seem to get the if statement inside the foreach loop to work and I think I am doing something wrong?

The error message I am getting:

ERROR <Ens>ErrException: <UNDEFINED>zS2+2^GWH.Messages.Eobs.AKISegmentCheck.Thread1.1 *k1 -- logged as '-' number - @' Set k1=request.GetNextIndex("PIDgrpgrp("_(1)_").ORCgrp()",k1,.tSCTrans)'

Can anyone explain that error to me?

Cheers

3
0 922
Article Eduard Lebedyuk · Mar 1, 2018 6m read

Everybody has a testing environment.

Some people are lucky enough to have a totally separate environment to run production in.

-- Unknown

.

In this series of articles, I'd like to present and discuss several possible approaches toward software development with InterSystems technologies and GitLab. I will cover such topics as:

  • Git 101
  • Git flow (development process)
  • GitLab installation
  • GitLab WorkFlow
  • GitLab CI/CD
  • CI/CD with containers

This first part deals with the cornerstone of modern software development - Git version control system and various Git flows.

1
4 4880
Question Fiona Griffiths · Nov 22, 2018

Hi

Is this a bug?  We came across it on an older version of Cache but I've also just tried it in version "Cache for Windows (x86-64) 2017.2.2 (Build 865U)" and got the same result.

Create a Class like so:

2
0 621
Question Ihsan Ahmed · Nov 21, 2018

I am quite new to Studio and I have been a Microsoft guy for a very long time and spoilt because of the short cuts provided and the flexibility of the IDE.  Any tips and tricks for me to make my life easy while using the studio?

1
0 287
Question Pravin Barton · Nov 20, 2018

For each instance of an XML-enabled class I want to control whether a property is projected as an empty element or not projected at all. With string properties, I can set the value as $c(0) for an empty element, or an empty string for no projection. But it looks like this isn't consistent for properties with type %Boolean or %Integer. With booleans $c(0) gets projected as "false". With integers $c(0) stays as a zero-width space in the XML output (which gives me a SAX parser error if I try to read it).

Is there a way to do this that works for all datatype properties?

2
0 666
Question Ogura Yui · Nov 20, 2018

Class A Extends %Persistent

{

Property Doctor1 As %Library.String;

Property Doctor2 As %Library.String;

Property Doctor3 As %Library.String;

}

I know my solution is wrong, but if i want to access A.Doctor1, can I  get a way like 

s count=1

s DoctorName="Doctor"_""_count

A.DoctorName="doctor1"

2
0 296
Question Jimmy Christian · Nov 20, 2018

Hello ,

I want the datagrid to reflect values based on the value i select in the Combobox.  How to pass value from the combobox to the

altJSONSQLProvider  parameter and reload the datagrid ?

My combobox defines below method on change.

onchange="zenPage.rowSelected(zenThis.getValue());"

<altJSONSQLProvider id="PatchClassJsonId" OnGetSQL="GetSQL" >
<parameter paramName="1" value="C"/>
</altJSONSQLProvider>

<dataGrid 

,......

</dataGrid>

1
0 253
Question Dmitry Maslennikov · Jul 20, 2018

Just got the new beta version of Docker, with depreciation warning of AUFS. It's so bad news when InterSystems does not support used by default storage driver overlay2. Recently I thought to play with Google Kubernetes Engine, and realized that I can't work with InterSystems products there due to incompatibility with Storage Driver. Maybe it's already time to think about support?

5
0 815
Article Hansel Rudy Stange Gaete · Nov 19, 2018 1m read

Working on a proyect with :

Cache Object Script, Jquery and Bootstrap :

I have a big problem to do pagination with parameter, to query filter and registry limitation, but i find a solution using session and global:

Set FilterDate = %request.Get("df")
If (FilterDate=""){
    Set FilterDate = $Get(^NSSession(%session.SessionId,"FilterDate"))
}
If (FilterDate'=""){
    Set ^NSSession(%session.SessionId,"FilterDate") = FilterDate
}
1
0 527
Question Rui Figueiredo · Nov 19, 2018

Hi,

I'm using InterSystem Cache v2015.2.5 and I'm implementing a REST API and returning JSON.

Following the documentation I see examples like this

Set obj = {"destinations": ["London","Madrid","Tokyo"]}
Write obj.%ToJSON()

However, I have a compilation error 

ERROR #1054: Invalid expression : '{"destinations":' 

Is there something that needs to be enabled on Studio to allow this syntax?

Thank you,

Rui

5
0 556
Question Lewis Greitzer · Nov 14, 2018

I created a custom class for a process that does some basic manipulation to an HL7 message. I'd like to be able to write some debugging to the process event log. How would I do that?

I've tried ##class(Ens.Util.Trace).WriteTrace("system","HOSP.IHE.PDQProcess","MessageHeaderHandler","Discarding input message")

but I get a runtime error when I try that. I know this is pretty basic stuff, but any help would be appreciated.

2
0 1097
Question Sean Connelly · Nov 16, 2018

Is there a responsive way to detect a source code change without using a source control hook?

Update

I have my own custom unit test tool which has lots of extra functions that I find useful such as Asserting HL7 Transformers and REST targets.

I have a studio hook that will send an event signal to my test runner that will automatically re-run a specific test class or test suite, for which I have a test runner viewing page that updates with the results.

There are some environments that already have a studio class registered and I don't want to shim something in-between the two.

8
0 621
Article Gevorg Arutiunian · Nov 16, 2018 2m read

The data model of your solution based on InterSystems platforms constantly changes over time. But what do you do with the data that was entered before? Back then, the data was valid, but what’s happening to it now after a number of data model changes? The answer to this question can be provided by the IDP DV tool that checks the property data of persistent and serial classes according to the types of these properties. In case any discrepancies are found, the tool generates a detailed error report for the user.

2
0 635
Question Alex Kogan · Nov 15, 2018

Greetings all,

I have a quick SQL question.  I am working with a class, which has a calculated property, which in turned indexed.
The calculation for this property is created based on another property value via: 
SqlComputeOnChange = attributes  - so basically every time I add a property attribute to my class, my new property 
is calculated based on some SqlComputeCode which calls some class method.

That initial setup works as designed.

1
0 314
Question Ben Spead · Nov 14, 2018

I need to write a script to answer a couple of fairly simple questions:

1) What is the current routine DB (name and location) for this namespace?

2) What is the current data DB (name and location) for this namespace?

3) Is global ^ABC mapped to a different location than the default data DB?

Can anyone point me to some system APIs that would allow me to answer these questions?

Thanks!

Ben

2
0 579
Question Jan Buschtöns · Nov 9, 2018

Hi,

I ran into the Issue https://hibernate.atlassian.net/browse/HHH-10620. The workaround  described at https://community.intersystems.com/post/support-java-hibernate-5 worked for me. I'm using Hibernate Version 5.3.2.Final.

It would be nice if someone from InterSystems could fix the the problem in Hibernate. That was mentioned in https://community.intersystems.com/post/support-java-hibernate-5 but it doesn't seem to have happened.

3
1 447