#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Question Sarvan Ibishov · Jan 29, 2018

Hi. I am newby in Cache. My source code at below. I have problem in Relationship property. Could you please help?

/// Class Test.Book Extends %Persistent{Property Name As %String;Property Author As %String;Property ISBN As %String;Relationship Chapters As Test.Chapter [ Cardinality = children, Inverse = bookid ];}
Class Test.Chapter Extends %Persistent{Property Name As %String;Property Page As %Integer;Relationship bookid As Test.Book [ Cardinality = parent, Inverse = Chapters ];}

then in terminal I am running these commands:

8
0 384
Question Eduard Lebedyuk · Feb 20, 2018

Several $System.OBJ methods have ByRef errorlog argument:

Compile(ByRef classes As %String = "", qspec As %String = "", ByRef errorlog As %String, recurse As %Boolean = 0)

ImportDir(dir As %String = "", wildcards As %String, qspec As %String = "", ByRef errorlog As %String, recurse As %Boolean = 0, ByRef imported As %String, listonly As %Boolean, ByRef selectedlist As %String)

What's the best approach of working with errorlog?

Do you convert it to status? If so - how? Manual iteration over local?

Is there some system method to convert it into %Status?

1
0 397
Question Arun Kumar · Feb 20, 2018

Hi Guys,

I would like to develop a login page in Zen mojo application with Desktop and mobile application.  It should be adopt with desktop, android and iOS application.

If any lead would be appreciated. 

Thanks,

Arun Kumar D. 

4
0 465
Question Young Bae · Feb 20, 2018

Howdy Developers of InterSystems Ensemble,

 

Has anyone experienced an alert generated from a business operation (BO), which uses EnsLib.SQL.OutboundAdapter? That comes with an error message as below:

ERROR #6022: Gateway failed: Execute. + ERROR <Ens>ErrGeneral: SQLState: (HY000) NativeError: [10054] Message: [Cache ODBC][State : HY000][Native Code 10054] [d:\cachesys\bin\cache.exe] [write_all: send() returned SOCKET_ERROR. Reason: (10054, 0x2746) An existing connection was forcibly closed by the remote host. ] (alert request ID=710761).

1
0 1541
Article Amir Samary · Oct 12, 2017 4m read

Hi!

It is often necessary to run some external command such as a python program or a shell script from inside Caché/Ensemble. There are three ways of doing this:

  • $ZF(-1) - Runs the command and waits for it to finish.  
  • $ZF(-2) - Runs the command and don't wait for it to finish.
  • Using CPIPE device - Runs the command and opens a device for you to read its output or (exclusive or here!) write to its input.
8
1 2756
Question David Crawford · Feb 20, 2018

I'm experimenting with sending large amounts of data in a POST payload to be stored as a stream. However I've noticed that no matter how many characters are in the message, Cache only gets about 32k of them, cutting off the rest. Conversely as expected it can only send about 32k worth of characters in a payload.

Before I get creative, is there a REST message size limit that can be changed? Or is there something else going on here?

Thank you!

9
0 1531
Question George Hodder · Feb 16, 2018

I am trying to use the automated unittest class for a %CSP.Rest service.

So my Unittest code set's %request and %response from %CSP.Req/resp respectively

I build a tProxy with the fields I need for the post and set it %ToJson... I have tried seting %request.Content = tProxy (and not)

I call the method for the post url directly... 

  When that method calls %fromJson to set an object with the info. I passed... 

      - when I don't set %request.content.. I get a error '5035 - premature end of data code 12'

7
2 1293
Question Eduard Lebedyuk · Feb 19, 2018

Let's say I want to execute  this cache script (saved as test.txt) from OS terminal:

zn "USER"
write 1
zn "%SYS"
write 2
halt

Executing the following command in a terminal:

csession cache < test.txt

Would yield this output:

$ csession cache < script.txt

Node: gitlab-test, Instance: CACHE

USER>

USER>
1
USER>

%SYS>
2
%SYS>
Job succeeded

Is there a better way to run these scripts?

Currently I have two problems:

  1. I have several variables defined in my bash script, what's the best approach to pass them into Caché? 
  2. I can't capture script input (for example write 1)
1
0 1159
Question Philip McClean · Feb 16, 2018

I have a dataListBox in ZEN which has an OnDrawItem method associated with it. The DrawItem method never seems to be called and I cannot see why.  I am using IE11. Can anyone suggest a reason? The attached code runs in a namespace called CODE and can be run using view webpage on the TheLabsApp.BioAnal class. Please note that the data is in a global called ^%ANAL that resides in %SYS.

3
0 318
Article Clark Matthews · Nov 3, 2016 4m read

Problem:

Caché prints to printers in a manner somewhat different from other Windows applications.  Caché sends the data directly to the GDI Printer, without the usual interface.  This is because the GUI interface can only be shown on a system desktop session and not in web browser and terminal sessions.  Some printer drivers have problems with this method of printing.

Is this the problem you are having?

3
3 3115
Question George Hodder · Feb 2, 2018

Hi.. I have an issue where we are using OAuth2.0 with the ZAUTHENTICATE routine.  Once our token is validated we are using a users lan id (passed on the ID token) to find a software defined username in a Cache Global.

That is all working fine in ZAUTHENTICATE.. I am setting the software defined username in the Properties("Comment") array and wanting to reference it in the Rest Service Dispatch class.

6
0 966
Question Jenna Makin · Jan 6, 2016

What are the best steps for troubleshooting printing to a Windows printer from Cache.  The printer has been configured in the Windows Printer Manager and has been able to print a test page (from the windows print manager).

The device has been configured in Cache -> Sys Admin -> Config -> Device Settings -> Devices with properly formatted |PRN|printer device name and "W" for open parameters and 101 for Alias.

From a command prompt, O 101 U 101 write something U 0 C 101 doesnt output anything to the printer, but does create a document in the Windows print spooler.

2
0 595
Question CJ H · Feb 15, 2018

I noticed that the subscript of the index map is actually the collated field (%SQLUPPER).

Is String the only data type going through this transformation? Any other data type would also go through this transformation?

Thanks. 

1
0 361
Question David Crawford · Feb 15, 2018

I'm sending data via ajax to my REST service, and while retrieving any information sent in the url parameter is easy when they're defined in the route, I can't get anything if I store information in the data parameter. For example:

$.ajax({
               url: "ServerURL",
               data: { "some": "json" } //How do I get this information?

...

I've looked at many common solutions such as here:

https://community.intersystems.com/post/lets-write-angular-1x-app-cach%C3%A9-rest-backend-part-9

8
0 1410
Question Jenna Makin · Sep 23, 2016

I was curious if application partners were developing their own task managers for scheduling background tasks, or using the built in task schedule that is part of the Cache platform.

For those that are using the Cache task manager, what has been your method for distributing default tasks that your application needs during initial install as well as upgrades?  Are you distributing an export of the %SYS.Task object, or perhaps you are distributing an installation script that adds a task to the task scheduler when it is first run?

3
0 3217
Question Mike Minor · Feb 9, 2018

I'm trying to learn how To use SQL in CACHE, so I hope I don't bore you with "Dumb" questions.... 

I'm getting "ERROR #6022: Gateway failed" message following this line of code. 

s sc=gc.Prepare(hstmt,pQuery) 

This line of code comes from an example I found in the documentation.  pQuery is the "Select" statement setting up the variables and tables I'm trying to pull information from. 

What does that error indicate? 

Thank you. 

5
0 1469
Question John Murray · Feb 13, 2018

Documentation here lists the kinds of members a class definition may contain. In summary:

  • Parameters
  • Methods
  • Properties
  • Class queries
  • XData blocks
  • Projections
  • (and some that are relevant only for persistent classes):
    • Storage definitions
    • Indices
    • Foreign keys
    • SQL triggers

Later in the same document, a section headed "Class Member Names" contains this warning:

So I'm interested to hear how other DC members handle this.

7
0 455
Question Soufiane Amroun · Jan 15, 2018

Hi community ,

i work actually on the access token generation method , i want know where the generated access token are saved ?

My [OAuth2.AccessToken]  tabe is empty , it's logical?

thank's for helping .

Best regards

5
0 892
Question Arun Kumar · Feb 5, 2018

Hi Guys,

I would to know, I have a drop down list items in my applications. While, am clicking on the drop down bx, there are few numbers of listed items, while am doing mouse over action, I should display the entire text of selected item from that drop down list box, even am not selecting that item. I would like to know about the what is exact text it contains in Zen framework. 

If any lead would be appreciated. 

Thank you in advance. 

13
0 1332
Question Nael Nasereldeen · Feb 11, 2018

Hi,

Is it possible to Save a base64 data string, representing a png, as a binary png file, In Cache?

When I search google , in general , not Cache specifically,  I see such articles:

https://stackoverflow.com/questions/11511511/how-to-save-a-png-image-se…

and this answer:

You need to extract the base64 image data from that string, decode it and then you can save it to disk, you don't need GD since it already is a png.

But I don't know how to implement that in Cache.

Regards,

Nael

2
0 5499
Question Anil S Sheno · Feb 9, 2018

Hi,

      Has anybody used /epic/prd/bin/runlevel with different options to bring up or shutdown the cache db. I cannot see any information about it in the manual.

Regards,

Anil

2
0 446