Caché

Syndicate content 116 

Previously I showed you how to run pButtons to start collecting performance metrics that we are looking at in this series of posts.

pButtons is compatible with Caché version 5 and later and is included with recent distributions of InterSystems data platforms (HealthShare, Ensemble and Caché). This post is a reminder that you should download and install the latest version of pButttons.

The latest version is always available for download via ftp.

ftp.intersystems.com/pub/performance

You need to download the file

+ 2   0 1
0

comments

636

views

+ 2

rating

Hi

I have been experimenting with the creation of a set of REST services for an app.  The basic GET operation is set to create a %ZEN.proxyObject instance, and then set an instance of a Persistant class as a property, which gives me all of the values I want to return.  However, it also gives me some values that I don't want to return over REST (because they are both private, and large registered objects which will bog down performance)

How do I remove these values from the ZENproxyObject?  I can only see a full clear() in the documentation, but nothing which can remove individual elements

 

Thanks

Chris

Last answer 30 March 2016 Last comment 30 March 2016
+ 2   0 2
220

views

+ 2

rating

Hello.

For debugging purposes I  sometimes need to display stack information to the current device or save it (to a global for example).

There is this snippet offered in documentation:

ClassMethod StackToDisplay()
{
    For loop = 0:1:$Stack(-1) {
        Write !, "Context level:", loop, ?25, "Context type: ", $Stack(loop)
        Write !, ?5, "Current place: ", $Stack(loop, "PLACE")
        Write !, ?5, "Current source: ", $Stack(loop, "MCODE")
        Write !
    }
}

And to save stack to a global there's always an exception method:

ClassMethod StackToGlobal()
{
    Set ex = ##class(%Exception.SystemException).%New()
    Do ex.StackAsArray(.arr)
    Set time = $ZDT($H)
    Merge ^StackInfo(time) = arr
}

But I'm interested if someone has a better code (more info) for this purpose? What's your approach to saving stack information?

Last answer 30 March 2016 Last comment 30 March 2016
0   0 2
462

views

0

rating

The attached file contains two $system.Event examples that processes work asynchronously using persistent queues:

Events_Simple

This is a very basic example that creates some worker processes and then enqueue messages to them using $system.Event

Last comment 30 March 2016
+ 2   0 4
618

views

+ 2

rating

I am pleased to announce the field test of Caché and Ensemble 2016.2 -  an exciting new release with improvements on many different fronts.

The entire product team at InterSystems looks forward to your participation in the field test and feedback over the coming months.

Some of the more profound changes in 2016.2 include:

  • Atelier - the new multi-platform IDE for Caché, Ensemble and HealthShare.
  • Introduction of a DOCUMENT data model (extending the reach of our multi-model capabilities)
  • Concurrent management and configuration of many servers

As always, there are a host of scalability and performance improvements, including improvements to the core database, ECP and SQL.  And hundreds of smaller improvements and corrections.

Summary details of these changes can be found HERE

Last comment 29 March 2016
+ 6   0 9
824

views

+ 6

rating

Hello! 

We use iKnow's GetSimilar for decision making. Right now we have a domain with both good and bad documents and using GetSimilar we want to see if a document is more similar to the good ones or the bad ones. To do this we simply compare the weighted average of the score from the good ones and the bad ones that GetSimilar returns.  

The problem is that GetSimilar doesn't always return the score to all other documents. Assuming we have 50 documents I would expect the following result:


DO ##class(%iKnow.Queries.SourceAPI).GetSimilar(.sim,domId,id,1,200,"",$$$SIMSRCSIMPLE, $LB("ent"))


:FILE:c:\file1.txt
sim(1)=$lb(1,":FILE:c:\file2.txt", 0.4239, 0.8615, 184, 78, 563, 0.4239)
sim(2)=$lb(2,":FILE:c:\file3.txt", 0.3967, 0.7704, 184, 73, 318, 0.3967)
...
sim(49)=$lb(49,":FILE:c:\file49.txt", 0.3967, 0.7704, 184, 73, 318, 0.3967)

Last answer 29 March 2016
0   0 1
0

comments

146

views

0

rating

If you are waiting for the Kindle Edition of Caché and MUMPS – Part II, I must apologize. I believed what others told me that once I have a book manuscript, the Kindle manuscript will be easy. Being a programmer I should have remembered: "never assume anything." The conversion to Kindle is proving a much bigger task than I thought. But don't lose heart, I am working full time on it. I have as my goal before May 1st. But, then again, you know what they say about goals. ;) - - Paul Mike Kadow

+ 1   0 1
0

comments

196

views

+ 1

rating

Hi Community: I have a legacy Caché based app that has Zlogin or %Zlogin routine. I understand that such routine will be invoked as soon as the user logs in. Can someone tell me where to find such routine? The namespace where the user connects to? Or in CACHESYS? Thanks, HT

Last answer 26 March 2016
0   0 1
0

comments

174

views

0

rating

I believe the I have followed the instructions to attach a document to the body of a post request but nothing is being sent out in the files{} port of the request.  I can either get the stream in "data", not visible at all, or visible but no form data. Any help would be appreciated, below is what I have

Last answer 24 March 2016 Last comment 24 March 2016
+ 1   0 4
1249

views

+ 1

rating

Please consider these two concepts:

Concept 1 - Web Service or Web Application or Server Side

Concept 2 - Client Service or Client Application or Client Side

Maybe I am just a Web/Zen newbie, if I am and you all understand this, I apologize. (no nasty remarks please)

The questions are numbered, if you wish to respond to an individual question please precede it by the question number.

  1. Is there consistency in naming these concepts?

 

  1. Are CSP, Caché Server Pages used for the Web Server Side only? Or both sides?

 

  1. The InterSystems documentation, Securing Caché Web Services, used for the Web Server side only?

I thought I understood Web Server Side and Client Server Side until I started looking into them, both in InterSystems documentation and outside documents

Last answer 22 March 2016
0   0 1
0

comments

239

views

0

rating

An XML-enabled class has an XMLExport() method that knows how to serialize an instance to XML. To export all instances of a class to a file, I need to instantiate a writer and loop through the extent. Is there no class method like XMLExportToFile() that does this in one go?

Last answer 20 March 2016 Last comment 18 March 2016
0   0 1
214

views

0

rating

I am happy to announce the immediate availability of  Caché and Ensemble 2016.1.

The highlights of 2016.1 are

  • Significant improvements in JSON support
  • Continued advances in SQL performance
  • Database scalability improvements
  • New REST services for DeepSee

These and other new features are summarized in this video introduction to 2016.1

For complete technical details of what’s changed in 2016.1, review the Caché release notes and the Ensemble release notes.  

Last comment 18 March 2016
+ 7   0 1
712

views

+ 7

rating

Straight-forward way to do it is well known and looks like this: 
------------------------------------------------------------ sample #1 --------

echo "Try to freeze Cache instance $instance"
rm -f $mydir/db_temp
csession $instance -U%SYS << EOF >/dev/null
zn "%SYS"
set rc=##Class(Backup.General).ExternalFreeze()
set fn="$mydir/db_temp"
o fn:("WNS"):1 if \$t u fn w rc c fn
h
EOF
read rc < db_temp
if [ "$rc" = "1" ]
then
 echo "...OK, system is frozen."
else
 echo "** Copy ABORTED: freeze rc = $rc"
 exit
fi

-----------------------------------------------------------------------------------

Documentation states that the same can be written in much more short and readable style (and it really works):

------------------------------------------------------------ sample #2 -------

Last answer 18 March 2016 Last comment 18 March 2016
+ 2   0 1
675

views

+ 2

rating

Here are a few tips that might be useful to people who are running applications in an environment that's configured to use InterSystems mirroring.

 

  • If you configure an ECP connection to a Caché instance that is a mirror member databases then the ECP connection should also have mirroring enabled (tick the mirroring box when defining the connection). More details here. You may also need to increase the number of ECP connections each end accepts, to cater for the way both members of a mirror pair get involved in ECP negotiation.

+ 3   0 2
0

comments

233

views

+ 3

rating

Hi,

posted some weeks ago in the "old" ZEN Google Group, maybe someone here can help to understand how to properly setting up a csp applications and contributing from the build-in caché security mechanism.

I´ve created a webapplication and wan´t to add further security to it using the smp. But... first things first.

I have two Databases let´s say DB1-LOGIN and DB2-Application. Each of this DBs has a resource assigned. DB1-LOGIN has a resource %DB1-LOGIN which has a public permission of 'read'. DB2 has a resource as well %DB2-Application with no public access.

I have defined two roles webapp-admin and webapp-user. Only webapp-admin and webapp-user are allowed to access DB2-Application. I´ve created to test users. test-admin (which has the webapp-admin assigned) and webapp-user (no special roles assigned). The CSP-Application in the smp has application role webapp-user. So test-user is automatically a webapp-user. So far so good

Last comment 16 March 2016
+ 1   0 6
0

answers

317

views

+ 1

rating

Among the outputs of our Yuzinji tool are two code metrics that it can be interesting to track over time as a development project proceeds. These are Size and XS. The first is fairly straightforward. As you write more code the size of your codebase increases. The XS metric (pronounced "excess") aims to quantify excessive structural complexity. XS is explained in some detail in this 2006 whitepaper from Headway Software, whose Structure101 toolset Yuzinji leverages.

By analyzing a codebase using Yuzinji at key milestones we can investigate how these metrics change. Here's a screenshot from a public repository we created from the classes in the SAMPLES namespace starting with Caché 2010.2 and reaching to recent 2016.1 and 2016.2 Field Test versions

Last comment 15 March 2016
+ 1   0 1
145

views

+ 1

rating

[SOLVED]

added 

>/tmp/compilew.log &>/tmp/compilew.log ; tail /tmp/compilew.log

to redirect the output to the stdout. Somehow the javac has wierd behavior with the output on errors and verbose information.

Hi,

i want the JAVA-Projections and wrappers to compile after Caché created the files. The creation of the files works 100%.

My addition to createProjection in our Projectionclass is following

Last comment 15 March 2016
0   0 2
0

answers

145

views

0

rating

If I have defined a class query in one of my classes and I want to use that query from a method of another class, what are the pros and cons of using the %SQL.Statement interface versus the %Library.ResultSet interface?

I believe %SQL.Statement is the newer interface.

So if the old way is:

USER>s rs=##class(%Library.ResultSet).%New("%Library.File:FileSet")
 
USER>s sc=rs.Execute("c:\s\","*.txt")
 
USER>w sc
1
USER>while rs.%Next() {w !,rs.Data("Name")}

...

then the new way is

Last comment 14 March 2016
+ 2   0 9
828

views

+ 2

rating

Hello! 

I'm trying to run a simple SQL query in atelier but it complains about the manager.  I'm not sure if this is the best way to do it but here is what I got so far:

 



	ZNSPACE "User"
	
	SET domId = 1
	SET flister=##class(%iKnow.Source.SQL.Lister).%New(domId)
	SET myloader=##class(%iKnow.Source.Loader).%New(domId)
 
 
	SET myquery="select top(10) EntityValue, CorpusFrequencyAsRelation, CorpusSpreadAsRelation from %iKnow_Objects.EntityUnique  WHERE DomainId = 1 ORDER BY  CorpusFrequencyAsRelation desc"
	SET idfld="EntityValue"
	SET grpfld="CorpusSpreadAsRelation"
	SET dataflds=$LB("CorpusSpreadAsRelation")

	SET stat=flister.AddListToBatch(myquery, idfld, grpfld, dataflds)	
		IF stat '= 1 {WRITE "The lister failed: ",$System.Status.DisplayError(stat) QUIT }
	SET stat=myloader.ProcessBatch()
		IF stat '= 1 {WRITE "The loader failed: ",$System.Status.DisplayError(stat) QUIT }


And the error I get

Last comment 14 March 2016
+ 1   0 7
0

answers

211

views

+ 1

rating

In the documenations at this location http://docs.intersystems.com/enscomm20152/csp/documatic/%25CSP.Documatic..., the normalize method applies normalizaion for text using the defined manguage and dictionary.

I want to normalize my iFind queries. How can I use the normalize method ? any code sample ? 

I want also to delete properly the iFind index. Deleting all the rows in the table is sufficient ? 

When quering iFind is it possible to get also TFIDF scores ? any code sample for this ?

 

Thank you for the help.

Last comment 14 March 2016
0   0 3
0

answers

161

views

0

rating

I have a tablepane in my Zen page that is tied to a class query.  When the page first loads, the table is empty.  A button onclick event causes the tablepane query to execute and load query results into the table.  I want an onchange event from a datalistbox to clear the tablepane so that it looks empty as it was when the page first loaded.  I have had no luck fiddling with javascript in the datalistbox's onchange.

Last comment 14 March 2016
0   0 2
0

answers

139

views

0

rating

A simple and rather automated search portal leveraging iFind capabilities for rich text search in 2016.1. It has simple faceting, result ranking, highlighting of search results etc and just works off any table you point it to that has an iFind index by appending ?t=MyPackage.TableName to the URL.

See also https://github.com/bdeboe/isc-iknow-ifindportal for more details and the latest version.

Last comment 14 March 2016
0   0 2
153

views

0

rating

I need to perform additional checks before Cache user logins (let's say in a terminal for simplicity) and allow access only to those, who passed them. How do I do it?

After reading about delegated authentication in docs I created this ZAUTHENTICATE routine

Last comment 10 March 2016
+ 1   0 8
0

answers

761

views

+ 1

rating