#Caché

1 Follower · 4.5K Posts

  

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

Documentation.

Article Chris Stewart · Apr 20, 2017 3m read

We finished our last lesson with our Widgets Direct page iterating over a list of widgets, displaying an ID and a Name value.  While we have been able to achieve this with only a small amount of coding, the page itself is not the most visually appealing place to be.  The AngularJS framework is providing a powerful Model-View-Controller framework for our structure and logic, but it does not implement anything that will provide a nice UI experience.  For that we need to implement a UI toolkit.  We have numerous options here; the leading toolkits are BootStrap from Twitter and Angular Material

3
0 1798
Question Pasi Leino · Apr 11, 2017

We are building a bunch of rest based services using Ens 2016.2 to serve our browser based application (Angular 4).

Two questions:

1. The initial authentication seems only work if credentials are placed in the url parameters.  Trying to use the Authorization header instead, the client code immediately complains about Access-Control-Allow-Origin. How can I resolve this?

2. After initial authentication, what is the proper way to send subsequent rest calls without having to include credential every time?

I have Parameter UseSession As Integer = 1 in my service class, but what else do I need to do?

7
0 2846
Article John Murray · Apr 24, 2017 1m read

If your application is raising <PROTECT> errors and you're finding it hard to work out why, here's a way to get additional information.

First, if auditing is not already enabled, turn it on:

Then use "Configure System Events" (highlighted above) and locate the event named %System/%Security/Protect. In the screenshot below I used the Filter field to do this (type "protect" - highlighted below - and press TAB):

1
0 2824
Question sansa stark · Apr 22, 2017

when the "/apps/docmatic/%CSP.SysConnection.cls" gets hit. If some page hit the above (%CSP.SysConnection) it consume license or not?

1
0 342
Question Sean Connelly · Apr 19, 2017

WebSockets look to be supported reasonably well in Cache. I have yet to use them in production so I am wondering how well it has worked for other developers.

In particular what happens when the browser does not support WebSockets, or when a firewall blocks the connection.

Have you had to write your own long polling fall-back?

I've read the documentation and found this interesting article...

https://community.intersystems.com/post/asynchronous-websockets-quick-tutorial

but no mention of long polling fall-backs that I can see.

15
0 11763
Question Stella Ticker · Apr 21, 2017

I am using a %Stream.FileCharacter object  and LinkToFile API to write to a file on a folder. The file is written line by line . Something like  below:-

Set tStream =   ##class(%Stream.FileCharacter).%New()

Set tStatus =tStream.LinkToFile("MyFileName")

For i=1:1:X  { Set result = ..process(i) Do tSream.WriteLine(result) }

1
0 1070
Question Susobhan Pandit · Apr 20, 2017

I am working in Cache Objectscript where I need to process around 0.2 million data.

I am executing SQL query through "%Library.ResultSet"

Code Example:

Set tsRSet=##class(%Library.ResultSet).%New("<query name>")
Set status = tsRSet.Execute(<param 1>,<param2>)
While tsRSet.Next()
{
     Business Logic
}

Is there any limitation of the above code when the number of records the query is fetching is high.

If the query returns 0.5 million to 1 million record will my code work properly or it may break due to high volume of data.

I have 4 GB RAM and 2 GB global buffer in my production system.

4
0 536
Article Chris Stewart · Apr 21, 2017 2m read

At the end of our last lesson, we ended with our page displaying a nice (but garish) Angular Material Toolbar, and our Widget data displaying in a list of Material cards.  Our page feels a bit static, and we already know that the large number of Widgets that we will be dealing with will not be especially usable on a static list.  What can we do to help?

0
0 1455
Question Paras Batheja · Mar 15, 2017

Hi,

We have a application developed in CSP and JS. Is there any way to make this application available in multiple language like Spanish etc.

We are ready to re-write the code in Zen also if it supports that feature.

Could any one of you please assist/advice a Solution to reach the required goal using Cache technologies, it will be a great help if someone has any sample code for the same.

Thanks 

Paras

7
0 526
Question Everardo Cunha · Apr 19, 2017

I wonder if you could help me? I have a regular cache class that accepts a variable number of arguments in one of the methods. It works fine so I decided to add a method to my web service to make the call to the cache class. I get a compile error on the web service with error#5130.

Here is the cache class

class method GenerateFileFromSQL(file As %String, sql As %String, delimiter As %String = "", args...) As %Status

and here is the web service code that calls it:

ClassMethod GenerateFileFromSQL(file As %String, sql As %String, delimiter As %String = "", args...) As %String [ WebMethod ]
 

2
0 899
Question Roger Beeman · Apr 20, 2017

Hi All -

I was wondering if the below query could be enhanced to automatically look back 24 hours from the current datetime the query is run. As is now I, of course, have to update the date range in the WHERE clause manually.

The query is just getting all MessageBodyClassNames, counting them and then doing an AVG on TimeCreated and TimeProcessed. Nothing too complex.

SELECT MessageBodyClassName, count(ID) as Count_Of_Messages, avg(datediff(ss, TimeCreated, TimeProcessed)) as avg_processing_time_in_seconds

FROM %PARALLEL Ens.MessageHeader

1
1 2733
Question Scott Roth · Apr 19, 2017

Awhile back we had someone write some code to Log messages like we did in eGate but with Ensemble.

ClassMethod LogIt(pComponent As %String, pMsgIn As %String)
{
 set vDIR="/ensemble/"_^OSUWMCInstance_"/logs/"
 set fs=##class(%Stream.FileCharacter).%New()
 set fs.Filename=vDIR_pComponent_".log"
 do fs.MoveToEnd()
 set vTM=$PIECE($ZDATETIME($HOROLOG)," ",2)
 //$ZTIME($PIECE($H,",",2),1)
 do fs.WriteLine(vTM_" : "_pMsgIn)
 do fs.%Save()
 set fs = "" // Close file
}

2
0 1450
Question Константин Ерёмин · Apr 20, 2017

Hi All,

I use SQL function JSON_OBJECT to get data as a JSON object.

However, sometimes I get error with function JSON_OBJECT when values contain [, ], { or }.

Error:

[SQLCODE: <-400>:<Fatal error occurred>]

Unexpected error occurred in JSON_OBJECT() function execution of <JSON_OBJECT>.%FromJSON().Parsing error

For example,

Query: SELECT JSON_OBJECT('idSQL':id, 'content':content) FROM DocBook.block

For demonstration, I used Management Portal, System Explorer – SQL, Execute Query

This text was in Content:

9
0 1490
Article John Murray · Feb 14, 2017 1m read

If you are developing applications that use CSP or Zen, or potentially any of the other InterSystems web-related stuff that's built on top of CSP, then it's important to know how to keep one particular secret.

A central part of the CSP security architecture is a server-side session key. "Server-side" because its value should never be revealed to the client that is issuing the web requests. If it is revealed, a malicious client might be able to use it to bypass your security and make your server do things you don't want it to.

1
0 719
Question prabakaran a · Apr 20, 2017

Hi All,

         We can sent the file to FTP server using CMD prompt.

         When trying send file using cache FTP. it automatically logged out.

          While cache FTP access (read/write) FTP server it automatically logged out.

CODE:

1
0 832
InterSystems Official Steve Brunner · Apr 19, 2017

InterSystems is pleased to announce the availability of the following maintenance releases:

  • Caché and Ensemble 2016.2.2
  • HealthShare Health Connect v15.021 on two core technology releases, 2016.2.2 and 2017.1.0

Caché and Ensemble 2016.2.2 are available on the same platforms as 2016.2.1

0
0 562
Article Fabian Haupt · Apr 19, 2017 2m read

Code coverage and performance optimization of code has come up a bunch of times already, so most of you should already be aware of the SYS.MONLBL utility. Often a visual approach to looking at code is much more intuitive than pure numbers, which is pretty much the whole point of this article series. This time we will take a slight excursion away from python and its tools and are going to explore generating heatmaps from ^%SYS.MONLBL reports.

0
1 648
Question Chris Bransden · Apr 19, 2017

Hi!

I'm trying to insert a relationship from a parent object instance to a child object instnace programmatically. Ie, i want to do:

Do parentObject.childRefProperty.Insert(chilDobject)

where childRefProperty is defined by a string. I feel this should be achievable with $PROPERTY and/or $METHOD or maybe something in $SYSTEM.OBJ.*, but can't quite figure it out. Anyone know?

Cheers :)

Chris

3
0 300
Article Chris Stewart · Apr 19, 2017 3m read

We finished our last lesson with our Widgets Direct page receiving a Welcome message as a property of a JSON object, which was unpacked and displayed on the page. However, we are on Lesson 3, and we still haven't had any talk of displaying widgets yet.  

Let's change that.  Widgets Direct are a leader in widget and widget accessories, so we clearly have numerous items to display.   To transfer this, we will need to declare and return our first array.  Let's go back to our REST.Dispatch class, and add this data to our Service.

0
0 1920
Question Alexandr Ladoshkin · Apr 18, 2017

Hello,

I work with trigger and I need afeter update make INSERT into LogTable value of prorerty of saved class.  This is what i have in this monent.

S className = ..%ClassName(1)
S cls=##class(%Dictionary.CompiledClass).%OpenId(className)
F i = 1:1:cls.Properties.Count() {
    S prop = cls.Properties.GetAt(i)
    S propName = prop.Name
    S value={propName*N}
}

How Can I get value given "prop".

Thank you

8
0 664