#Caché

1 Follower · 4.5K Posts

  

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

Documentation.

Question Scott Roth · Jun 29, 2018

I wrote a ZAUTHENTICATE.mac a couple of months back, and found recently that it is creating coredumps on almost a nightly basis. I think I have figured out this problem to be not clearing out my MsgSearch after I am doing 2 of them within the code.

1. Get User Attibutes from AD

2. Get User Groups From AD

So while I am trying to cleanup the code I thought it would be a good time to add a Certificate and TLS to the mix since I should of been using that all along. However I keep running into issues

Error message: Cache error: <UNDEFINED>ZAUTHENTICATE+104^ZAUTHENTICATE *LD

14
0 586
Discussion Evgeny Shvarov · Apr 22, 2018

Hi, Community!

Have a question for general discussion. 

In ObjectScript we have cls for classes and mac code, which both compile into int code. 

Is there any reason when you use mac instead of cls  for non-persistent classes?

For me the benefits for cls are:

1. Inheritance and other OOP features

2. Auto-documented code 

For mac one visible benefit is easier call in terminal:

do method^Utils(p1,p2)

vs

do ##class(Package.Utils).method(p1,p2)

What is your choice and why?

43
1 2976
Edit
Article Gevorg Arutiunian · Jul 17, 2018 1m read

The following code snippet contains a class method "test" that determines the value of a specified property for an instance of its class:


/// get property value within class by indirection
Class objectscript.getPropOfThisClass Extends %RegisteredObject
{
	// extra code to help test
	Property myProp as %Integer;
	
	// need to instantiate an object to access property value
	method test() {
		// extra code to help test
		set ..myProp = 32
		
		// code from the CODE post
		set property = $PROPERTY($THIS, "myProp")
		
		// extra code to help test
		write property
	}
}
0
0 0
Edit
Article Gevorg Arutiunian · Jul 13, 2018 1m read

This code snippet uses GZIP to compress and decompress a file in the file system. Change default file paths to customize code to compress/decompress your files:

Class objectscript.GZIP Extends %RegisteredObject
{
	classmethod test() {
		//Export Global(s) uncompressed
		set filename="C:\Temp\myglobal.xml"
		do $System.OBJ.Export("^oddEXTR.gbl",filename)
		//Open exported Globals
		set uncompressed = ##class(%FileBinaryStream).%New()
		set uncompressed.Filename=filename
		Set compressed = "C:\temp\mycomglobal.xml"
		//Open File Device over Gzip and Copy Uncompressed information to it
		Open compressed:("WUNK":::/GZIP=1:/NOXY=1:/OBUFSIZE=32768):0
		Use compressed
		do uncompressed.OutputToDevice()
		close compressed
		//Create New File  
		set out = ##class(%FileBinaryStream).%New()
		set out.Filename= "C:\Temp\decomp.xml"
		//Open compressed File and save information uncompressed over gzip
		Set file=##class(%File).%New(compressed)
		Do file.Open("RUK:::/GZIP=1:/NOXY=1")
		while ' file.AtEnd
		{
		    set line = file.ReadLine()
		    do out.Write(line)
		}
		do out.%Save()
	}
}

GitHub: https://github.com/intersystems-community/code-snippets/blob/master/src/cls/objectscript/GZIP.cls

0
0 0
Question Laura Cavanaugh · Jul 12, 2018

I have a class that has a property calledTags (like DescriptiveWords, but tags), where multiple tags are possible.  I am trying to decide on list of Objects vs. array of Objects.

Based on this post: https://community.intersystems.com/post/querying-list-property-sql, sounds like using an array of Objects is the better way to go. Indeed, I already noticed that it's not possible to have duplicates when using an array of Objects.

However, I am unable to make my queries on the array of Object use an index.  

4
0 944
Edit
Question Stuart Byrne · Jul 11, 2018

Hello,

I'm just re-going through the Caché foundations course exercises using a copy of Try-Caché on my home pc.

I'm trying to create a web application to receive REST calls however, when I use the Restlet client I get no response.

My web application config is:

0
0 0
Question Manish Valecha · Jul 10, 2018

Hi I am getting below error in xDBC error log

<-400>:<Fatal error occurred> <READ>Dispatch+14^%SYS.BINDSRV ServerLoop

When I check the detail of error I am getting below information. Please suggest as our schedule job getting failed due to same error.

2
0 527
Question Jay Ayliff · Jul 9, 2018

I'm trying write a JavaScript generator to perform pattern match validations using existing pattern match expressions in a legacy application.

I could make a server call to perform the pattern match operation but is there a way to automatically translate the pattern match expressions into RegEx expressions so I can perform the operation in JavaScript on the client to save making an Ajax call back to the server?

Thanks

Jay Ayliff

M-Tech

2
0 552
Question Pradip Patoliya · Jul 7, 2018

I am trying to fetch the data from cache database. But i got the error like "CSP application closed the connection before sending a responce".

Below is the query.

SELECT
CallbackComment
FROM SQ.CBPhoneResult_View Where PhoneDateODBC = '2018-04-09'

I have investigated and found that "CallbackComment" contains the special character single quotes " ' "  for one result and due to this i got this error.

In this field data is enter by customer. so we cannot restrict them like Do Not use single quotes.

Please provide some solution as soon as possible.

Thanks in advance. 

30
0 1778
Question Tony Beltz · Jun 29, 2018

Lost the raid array on our server. We were able to recovery all the data from backup but now are running into road blocks getting the Cache database up and running. We are running version 5.0.7 which is quite old but works for our needs. Our most current road block it is getting CTTerm (Telnet) to connect with the database. After entering the user and password nothing happens beside the carriage return dropping down one more line in CTTerm.  If you are familiar with the older revs of Cache please feel free to contact me or provide input.  Any help or direction would be invaluable to us. RAM

2
0 496
Question Davidson Espindola · Jun 21, 2018

Hello everyone

I have a problem with $ ZF (-1)

I need to delete file from windows folder example c: \ sys \ text.txt, when executing the w $ zf (-1, "c: \ sys \ text.txt") command, the file does not delete.
There is some other cache command that performs this task.

hugs

Davidson

8
0 1254
Question Chris Bransden · Jul 4, 2018

Hi, I found some issues with $ZF(-100) whilst replacing our old $ZF(-1) calls following the security alert. They're easy enough to work around, just figured it might be useful to someone :)

 

There seems to be some inconsistency with how $ZF(-100) is functioning between Unix and Win, contrary to the documentation. For example, for a simple ‘output directory listing to file’  operation:

 

Windows:

set dev="dir.txt"

set com="dir"

set options(1)=""

set options(2)="e:\nbupg\webserver\"

w $ZF(-100,"/SHELL /STDERR=""NUL"" /STDOUT="_dev,com,.options)

 

Expected result (output of dir e:\nbupg\webserver\):

5
0 1327
Question Dineshkumar Muniyasamy · Jun 20, 2018

Hi All,

On button click from my zen page am calling the $System.SQL.ShowPlan() to calculate the cost of the SQL query.

In Cache` 2016.2 I faced a problem , when the logged in user didn't have the %development resource(<PROTECT> error).

But in Cache` 2017.2 it's working without the %development resource.

Is there any changes done on this area in the versions above 2016.2.

Thanks,

Dinesh

2
0 325
Question CM Wang · Aug 16, 2017

I try to run below two statements

Set tRS = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:SubclassOf")
​set tSC = tRS.Execute("%Persistent")

and I always get <PROTECT>check+5^%Dictionary.ClassDefinitionQuery.1

The login user is _SYSTEM and should have all the permissions.

I cannot run queries in the $SYSTEM.SQL.Shell(). I would get <PROTECT>%GenerateMetadata+16^%SQL.StatementMetadata.1

However, when I run the query through SMP, everything is fine.

Any idea where could I start to investigate ?

Thanks.

5
0 3132
Article Chris Stewart · Apr 21, 2017 3m read

or "Didn't you say you would cover Persistent Objects in Part 5, Chris?"

Yes, that was the plan.  This is a pretty important topic, so it get's its own Article

Up until now, we've display widget JSON that has been created by a basic loop.  Clearly this isn't of much value.  Now we have our stack connected together, and we can see that the data is flowing to the Welcome page, it's time to complete the stack and start feeding our service from "real" data.

4
0 1633