I have a MySQL server with "posts" table.

I also have a Caché server with "downloadedposts" table.

They are connected from Caché to MySQL via SQL Gateway

I want to keep Caché table synced with MySQL one (MySQL "posts" table is a master copy), so periodically Caché queries MySQL server and downloads data. So far so good, and if a record appears or changes in MySQL table, Caché downloads the changes.

The problem I'm encountering is that sometimes rows would be deleted from MySQL "posts" table.

How do I synchronize deletions?

2 4
0 1.1K
Question
· May 23, 2016
REST and IO redirection

Problem: I have a REST broker, and if I hit a code block, which does IO redirection, the REST reply becomes broken in one of the following ways:

  • Binary output
  • No output
  • First 4096 characters of the reply are missing

Consider the following REST broker:

4 3
1 1.1K

All responses are appreciated. I am new to both scripting and CACHE so please bear with me. I am setting up a nightly backup script for freezing cache then backing it up and then thawing it back out. Currently when I enter the freeze command I am getting a response of access denied even though my id has %all access. I've tried passing the userid/password as a parameter in the externalfreeze command and passing it from a file. I've used my id and lastly I used the _system id in the file. What ID should I use for this or am I passing it wrong?

0 17
0 1K
Question
· Aug 25, 2016
Iterate through global

Let's imagine I have a global like this:

^Users(12, "SETTINGS", "IsAllowed") = 1

^Users(41, "SETTINGS", "IsAllowed") = 0

^Users(52, "SETTINGS", "IsAllowed") = 1

Now I would like to check for each user whether they are allowed, therefore I'd need to iterate through the Global. How to do that? It seems that I can't use $Order here like such:

S FF = ""
For {
S FF=$O(^Users(FF,"SETTINGS","isAllowed"))
Q:$L(FF)
W "User ",FF," is allowed",!
}

Is there any other way of doing this?

0 5
0 1K
Question
· Apr 28, 2016
Cache Installation Issue

Hi,

Our Cache server(version 5.0.15) has recently crashed. We are in the process of recovery. We had replaced the server's hard disk and trying to install the cache(5.0.15) But getting the following error. Any body show some light on the issue.

CctrlInstallStartCP( CACHE ) failed! Return value: 1
CctrlGetLastError() returned:

0 2
0 1K

I try to run the cmd command in the studio terminal, but i am getting the <NOTOPEN> Error.

Even ZF(-1) also not working. Any help, Please!!!

Note: i restart the Cache instance service with full privilege

Code:

Set Path="mkdir E:\Sample\New"

Open Path:"QR":10

Error:<NOTOPEN>

This command working on my PC, but on server throws error.

Many Thanks

0 3
0 1K

Hi,

I am new to Cache and I am trying to convert a JSON string (msgdata) that contains a JSON payload to an object to be saved into a Driver. Entity table. I am running into 2 issues and would appreciate any help:

1) It seems that when the 1st element of a list within the payload (Choices) is an empty string, after I call %ConvertJSONToObject, the obj.%data("payload").Choices contains just 1 empty element, removing the next 3 valid values (10,20,30). The same does not happen if I change the input to [10,20,"",30], in this case it works correctly.

0 3
0 973
Question
· Feb 18, 2016
Message Error - CSP.Page

The cache has error messages default, for example , " -139 SQLCODE : Competition impairment on the update: row versions are not the same. "

How i can exchange it for a more friendly to the user's message? I use the CSP.Page and form_save ( ).

What is best practice for this situation?

2 3
0 967

I have to disect thousands upon thousands of strings like this:

96842-2-AEV.00001-63561-001958-100728760I-42

I've been able to pull out the first, second and final segments as separated by hyphens, but now I have a predicament where I need to use the second segment, the 2 shown in the example above, in a join to another table. Problem is Cache apparently doesn't like doing that. Just the same, I have to find a way.

Here's the code I'm using to pull that segment out into as separate field in the query results:

0 2
0 962

I know %CSP.Daemon is supposed to clean up old CSP sessions (?). In my management portal, under System/ License Usage, I see 33 "Units" used (and there are 33 licenses in use), but usernames from old IP address and that are not being used. Their active times are often in the millions of seconds. They are not "on" the system right now.

At most, only 3 users are on the system right now.

Are these supposed to be cleaned up? Can I clean them up programmactially, and how would I know if they're not active?

Thanks,

Laura

0 8
0 958

Hi


I have been working on changing a web application from using %FileBinaryStream to storing and serving the file content from a %Stream.GlobalBinary property, stored in a new database. I have managed to migrate the data across, and have also been able to redirect the stream so that it is being served through the web link. However, the previous method set attributes on the File stream to have the stream be rendered as the original file type through MIME, using this code

0 2
0 950

Here's an easy one for you; before I spend another hour looking for the answer, how do you convert %ArrayOfDataTypes to an array (that could, say, fit into the %session.Data array, or maybe just some array named info()), and of course back again?

NS>s aodt=##class(%ArrayOfDataTypes).%New()

NS>w aodt.SetAt("lcavanaugh","username")
1
NS>w aodt.SetAt("organization","coolcompany")
1
NS>w ##class(%ArrayOfDataTypes).BuildValueArray(aodt,.array)

<LIST>zBuildValueArray+1^%Library.ArrayOfDataTypes.1

1 3
0 950

In writing some code on:

Cache for Windows (x86-64) 2015.1 (Build 429U) Fri Feb 13 2015 14:37:23 EST

I noticed an unexpected "ROLLFAIL" error when a Unique Index fail was generated in a %Save() call.

The object SHOULD fail to save, since the Unique criteria is not met, but I didn't expect to see a ROLLFAIL error as the "Last Error".

When running the following class code:

0 4
0 941

Hi,

I am working on a DataGrid based upon ZenTest.Datagrid.cls

I want to save data after changes on a row.

The existing samples do not explain how to save changes on data in a grid.

I have tried something like zen(‘json’).save

Does anybody has some sample code?

0 4
0 940

在Aix7.1上安装使用root用户安装cache2016.1.1.107,且在安装过程中创建cacheusr用户;更改操作系统上的cacheusr的umask后,通过数据库修改编译后的文件(如,js,csp等)在小机上查看权限不变(-rwxrw-r-- cacheusr cacheusr test.js)。

目的:通过数据库编译后的文件的other用户有读写权限。

5 3
0 936

Hi-

I have created a class that extends %Persistent and %Populate and have set the various POPSPEC attributes of my properties to control how the properties are populated. However, when I compile the class and try to run the Populate() method it tells me the method isnt defined.

Here is the class definition:

0 2
0 929

Hi,

I sometimes get asked if Weblink will still be available (as a downloadable ad-on these days) for some versions to come.

I realize that this is old technology now, and that there are better and faster ways to do the same things today.

Thanks

S

0 3
0 929