Object Data Model

Syndicate content 10 

Have some free text fields in your application that you wish you could search efficiently?  Tried using some methods before but found out that they just cannot match the performance needs of your customers?  Do I have one weird trick that will solve all your problems?  Don’t you already know!?  All I do is bring great solutions to your performance pitfalls!

As usual, if you want the TL;DR (too long; didn’t read) version, skip to the end.  Just know you are hurting my feelings.

If you open up your version of Sample.Company in the SAMPLES namespace of a recent (2015.1 or later) Caché/Ensemble/HealthShare version you will see a Mission field that is pseudo-randomly generated text.  Suppose we want to search this text field.  For the purpose of this exercise, I generated about 256,246 companies – feel free to populate some on your own and follow along.  Well you might run the following query

Last comment 12 days ago
+ 19   1 3
1225

views

+ 19

rating

I have a lot of string properties, which need custom but similar Getters and Setters.

Currently I'm generating Getter and Setter in class generation code but that expands class definition.

Is there a way to specify custom datatype which would generate custom getters and setters?

Last answer 9 April 2019 Last comment 10 April 2019
0   0 2
124

views

0

rating

How Tax Service, OpenStreetMap, and InterSystems IRIS
could help developers get clean addresses

 

Pieter Brueghel the Younger, Paying the Tax (The Tax Collector), 1640

 

In my previous article, we just skimmed the surface of objects. Let's continue our reconnaissance. Today's topic is a tough one. It's not quite BIG DATA, but it's still the data not easy to work with: we're talking about fairly large amounts of data. It won't all fit into RAM at once, and some of it won't even fit on the drive (not due to lack of space, but because there's a lot of junk). The name of our subject is FIAS DB: the Federal Information Address System database - the databases of addresses in Russia. The archive is 5.5 GB. And it's a compressed XML file. After extraction, it will be a full 53 GB (set aside 110 GB for extraction). And when you start to parse and convert it, that 110 GB won't be enough. There won't be enough RAM either.

+ 2   2 1
0

comments

130

views

+ 2

rating

First time post, also a new Cache developer, hence the <Beginner> tag.

If our data has Predefined terms in a dictionary, and a user can add terms on their own, can the terms exist in different tables?

Lets call the tables "Terms" and the user data in "UserTerms".

If a third class definition has a property of "Term" can it not be either Terms or UserTerms?

I'm leaning towards using a Subclass strategy where the pseudo "Parent" (forgive me) is  Dictionary.Term and the child is along the lines of Dictionary.Term.User

Dictionary.Term.User can inherit from Dictionary.Term and this is stated in the Docs "If class B inherits from class A, you can use an instance of class B in any location where you can use an instance of class A."

This applies to properties of a class correct? Not just methods

Last answer 26 March 2019 Last comment 28 March 2019
0   0 3
76

views

0

rating

Hello,

We have defined four BPL Business Processes. One gets occasionally errors when pool size is two. No errors happen with pool size one. The error happens on calling %Save() on a large objects with many references to other objects.

Error #5803: Failed to acquire exclusive lock on instance of 'classname'.

Error #5002: Cache error: <ROLLFAIL> %TRollBack+10^%occTransaction

The error happens on a particular large object.

Our FileService gets the same Errors #5803 and #5002 with class 'EnsLib.EDI.X12.Document'

Another BPL gets the same errors #5803 and #5002 with lock on instance of 'EDIGW.BPL.ST837.Context

Any explanation or suggestion are welcome.

Last answer 30 January 2019 Last comment 27 March 2019
0   0 2
128

views

0

rating

Is it possible to mimic what selenium does like navigating to a site and logging in  and filling out a form then logout in COS.I am trying to do that in COS using %Net.HttpRequest class or should I be using a different class the idea is to be able to call a web app login into it and fill out form and log out

Last answer 18 March 2019 Last comment 11 December 2018
0   0 3
176

views

0

rating

Our lab system is now sending DSC segments in large Pathology results in the ORU message that is followed by a partial continuation message with only MSH and OBX segments.  the  pointer is in the MSH;14 in the subsequent message.  I believe the goal is to concatenate the first and second message but imagine this will require some custom functions which I have not done much of.  Anyone already tackled this by chance? 

Initial message

Last comment 6 March 2019
0   0 1
0

answers

78

views

0

rating

ˮ This is one of my articles which was never published in English. Let's fix it!

Hello! This article is about quite a practical way of developing InterSystems solutions without using the integrated tools like Studio or Atelier. All the code of the project can be stored in the form of "traditional" source code files, edited in your favorite development environment (for example, Visual Studio Code), indexed by any version control system and arbitrarily combined with many external tools for code analysis, preprocessing, packaging and so on

Last comment 2 March 2019
+ 6   5 3
814

views

+ 6

rating

I have an application which is distributed across maybe 5 servers since it has over a thousand users at a time we had an upgrade to the application last week and I had an integration build that uses the REST service (  ##class(%Net.HttpResponse) but since the upgrade the integration has not be able to communicate with the application tried testing my URL through Postman and all seems ok but if I test direct  I get a 500 error anything that I need to check on please or any advice on how to check what's going on. I have used SoapUI with 200 result so as postman and swagger

Last answer 3 December 2018 Last comment 18 February 2019
0   0 2
104

views

0

rating

I've been wondering about some code that I have come across a lot over the years.

Let's assume I have class Cinema and class Film.
Conceptually the data in these classes are never really physically deleted but only flagged as such, due to business requirements.

What I find is that developers tend to create a 3rd class "CinemaFilms", in a child relationship to parent Cinema, with a reference to Film. Rather than a one-to-many between Cinema and Film. 

Class CinemaFilms
{

Relationship cinema As Cinema [ Cardinality = parent, Inverse = Films];
Property film As Film;
}

The only reason I can think of, why we do this, is to avoid classes becoming a spaghetti mess of relationships(knowing it will break referential integrity).

Would it make more sense to use Collections here(array of/list of)

Last answer 7 June 2017 Last comment 13 February 2019
0   1 6
483

views

0

rating

Hello.

I just noticed that whenever I parse a JSON using %FromJSON, it always return the property values as primary data types, including long strings.

I did a quick stress test to measure it's capabilities and found out that characteristic,  this is something I needed to figure out beforehand  to implement my REST lib.

What I concluded is that %Dynamic depends solely on volatile storage? What if the user doesn't have long string support enabled or if the server has not enough memory to handle long strings?

Is there a fallback for handling it?

Please note that is an extreme and unusual use case, specially the last one, but I wanted to figure how to handle it accordingly.

Last answer 9 August 2017 Last comment 13 February 2019
0   2 5
451

views

0

rating

Edit:

May have found the issue but not the solution.

"SELECT * FROM wmhISTORYdETAIL" runs as a passthrough without asking for the DNS.

but

'SELECT Count([wmhISTORYdETAIL].[HistHMNumber] AS CountOfHistHMNumber FROM [wmhISTORYdETAIL] WHERE ((([wmhISTORYdETAIL].[HistMovType])='Receipt') AND (([wmhISTORYdETAIL].[HistMovDate])>=Date()-1) AND (([wmhISTORYdETAIL].[HistMovDate])<Date()));'

asks for the DNS but both are linked to a table that has the password saved.

Any Ideas please?

Rob

Hi

I have created an MS Access database with a passthrough query to our Intersystems Cache WMS system. If I use "SELECT * from thetable"  as the passthough query I can use VB.NET to query the passthrough and it works fine but this dataset getting rather large so I changed it to

"Select field1, field2, filed3 from thetable" but the passthrough no longer works as it did.....it works in MS Access but not from the VB.NET app

0   0 0
0

answers

0

comments

55

views

0

rating

Hello,
Having difficulty with sending POST request.

How I can send parameters in the body of request, if i'm using ContentType:"application/x-www-form-urlencoded".

Version of ensemble: 2010

My code is bellow:

Set httpRequest=##class(%Net.HttpRequest).%New()
set httpRequest.SSLConfiguration="1"
Set httpRequest.ContentCharset="utf-8"
Set httpRequest.Server="test.oath.com"
Set httpRequest.Port=443
Set httpRequest.Https=1
Set httpRequest.Location = "/auth/key"
set httpRequest.ContentType="application/x-www-form-urlencoded"
Set httpRequest.ContentCharset="utf-8"    
do httpRequest.EntityBody.Write("grant_type=client_credentials&scope=num&client_id=random")
Set httpRequest.Timeout=119
do httpRequest.Post("",2)

the resul

Last answer 12 February 2019
0   0 1
0

comments

401

views

0

rating

Hello all,

I have an XSL question and I wanted to see if someone within a community can help me out.  

To Summarize: I am working with XSL documents, single and multi-pages.  
Inside my style sheet XML document, which is supporting my pages, everything on the page, including a headers, footers and the items are calculated 
based on the portrait measurements. 
Pages come up on the screen as portrait, but sometimes, depending on dynamic data are wide, they do not print properly in portrait.

If I turn them to  print in Landscape, now the page fit fine, but the measurements which were calculated for portrait do not readjust and therefore I have issues, specially with footers, which are never at the bottom of the pages anymore

Last comment 2 February 2019
0   0 2
0

answers

65

views

0

rating

In most cases, if one class depends on another, the class compiler will detect this and determine the correct compilation order. For example:

  • Compiling a superclass triggers compilation of its subclasses.
  • Compiling a custom datatype class triggers compilation of any classes with a property of that type.

Yet sometimes, a developer needs to specify compilation order. InterSystems class definitions contain two keywords for this, DependsOn and CompileAfter, that are very similar but not identical. They are useful during development, and also when importing and compiling a set of classes for the first time.

The documentation for these keywords is here

Last comment 31 January 2019
+ 4   0 3
414

views

+ 4

rating

Hello Cache Developers:  I was curious if anyone has ever created a TWAIN interface to their Cache Application?   I am new to TWAIN and hence the reason for this question.  From what I understand, TWAIN is software used by various digital imaging software and TWAIN provides an API for applications to call to be able to import images into their application.   I work with a healthcare application and was wondering what types of things are required for a Cache Web Application to call the TWAIN API to be able to load images into a Cache table.    Any input, sample code, or suggestions is appreciated.   Thanks and Have a Great Day!    Happy Coding.

Last answer 27 January 2019 Last comment 29 January 2019
+ 1   0 3
123

views

+ 1

rating

Let Say I have 
Class Carrier Extends %Persistent

Property Employee As Array of Class Employees

Class Employees Extends %SerialObject

Property Name As %String

Property Address As Array of Class AddressDetail

Class AddressDetail Extends %SerialObject

Property Street1 As %String

Property Street2 As %String


I can get value for Employee Name  as Employee_Name.

But I want to Get Value of Address Street1 and Street2 of Class AddressDetail using SQL Query
How can I get that?

Last answer 18 January 2019 Last comment 25 January 2019
0   0 2
132

views

0

rating

Hi All,

Actually I am trying to implement a RESt API where in I will get ZIPCODE as request and I need to call external API which will take ZIPCODE as input and give State and City in response.

But the problem is the request is in XML Format and also response is in XML format.

Example :

https://XYZ.com/ABC.dll?API=CSLookUP&XML=<CSLookupRequest USERID="USERID">
<ZipCode ID='0'>
<Zip5>20024</Zip5>
</ZipCode>
</CityStateLookupRequest>

and in Response 

<?xml version="1.0" encoding="UTF-8"?>
<CSLookupResponse>
    <ZipCode ID="0">
        <Zip5>20024</Zip5>
        <City>WASHINGTON</City>
        <State>DC</State>
    </ZipCode>
</CSLookupResponse&gt

Last answer 24 January 2019 Last comment 24 January 2019
0   0 2
99

views

0

rating

Headache-free stored objects: a simple example of working with InterSystems Caché objects in ObjectScript and Python

Neuschwanstein Castle

Tabular data storages based on what is formally known as the relational data model will be celebrating their 50th anniversary in June 2020. Here is an official document – that very famous article.  Many thanks for it to Doctor Edgar Frank Codd. By the way, the relational data model is on the list of the most important global innovations of the past 100 years published by Forbes.

On the other hand, oddly enough, Codd viewed relational databases and SQL as a distorted implementation of his theory.  For general guidance, he created 12 rules that any relational database management system must comply with (there are actually 13 rules). Honestly speaking, there is zero DBMS's on the market that observes at least Rule 0. Therefore, no one can call their DBMS 100% relational :) If you know any exceptions, please let me know.

+ 4   3 1
0

comments

274

views

+ 4

rating

 

Good day.

The issue is related to Cache Studio. I wrote a plugin for creating reports using FastReport. The plugin is called via the context menu. In this case, the class is   d ## (%ZFastReport.SourceControl) .InstallSorceControllAllNameSpace ().

RunContextMenu

Example:  https://github.com/MyasnikovIA/CacheFastReport 

0   0 1
0

answers

0

comments

62

views

0

rating

This is a quick note on what happens when, on your CSP page, you call a cache script which returns a %Boolean and store that value in a javascript variable.

When you call a script with language="cache" and returntype="%Boolean" from a javascript script, the return value is interpreted as a string, not as a boolean.

Here's an example:

A cache script that returns (in theory) a "false" value

Last comment 16 January 2019
0   0 1
169

views

0

rating

Found a strange documentation block about Python bindings in Chapter 3.6 of the Caché manipulation functions with time and date. It looks like this text accidentally copied one to one of the Perl binging documentation. It's funny that the packages of functions called PTIME_STRUCTPtr, PDATE_STRUCTPtr and PTIMESTAMP_STRUCTPtr is suspicious for Python :)  

On the other hand, nothing is said about the functions parse_time, parse_date, parse_timestamp, which are present in /dev/python/intersys/pythonbind.py ahhh!

Has anyone encountered this problem?

Last answer 14 January 2019 Last comment 15 January 2019
+ 2   1 3
159

views

+ 2

rating

I created the Process to extract the required data from ADT message to a Dynamic Object. I wanted to send the JSON stream to EnsLib.File.PassthroughOperation operation and generate a file with the content of JSON stream.

Here are the codes for Process:

set oMetadata = ... /// metadata is from ADT message which is dynamic object

set jsonRequest = ##class(%ZEN.Auxiliary.jsonProvider).%ObjectToJSON(oMetadata)
set tSC = ..SendRequestAsync(..JSONOperation,jsonRequest,0,,..MetadataContext)  /// send the jsonRequest to operation

Here are the errors in the operation: "ERROR <Ens>ErrGeneral: No MessageBody classname for MessageHeader

Last answer 12 December 2018 Last comment 9 January 2019
+ 1   0 3
205

views

+ 1

rating

We are currently using Ensemble on AIX. We are on 2015.2.2. If I install Field Test on a windows desktop, is it possible that I can import the Cache.dat from my AIX server, so I can do some Proof of Concept development?

Thanks

Scott

Last answer 7 January 2019 Last comment 7 January 2019
0   2 3
142

views

0

rating

Has anyone called any outside Javascript code from inside their class files? I asked a long time ago if there was a way to manipulate an image within Cache Object Script, and since Cache doesn't have any image libraries its not really possible. However I have found Javascript to resize an image and wonder how hard it would be to mesh the two together.

Can anyone share any examples?

Thanks

Scott

Last answer 22 December 2018 Last comment 4 January 2019
+ 2   1 3
451

views

+ 2

rating