Nouvelle publication

Rechercher

Question
· Avr 30

Serialised classes, exports and development environments

We have classes in a Production environment that are causing us some issues - example attached.

When we export them from the production environment the XML contains a snippet like the following:

<UDLText name="T">
<Content><![CDATA[
//Property any As list Of %XML.String(XMLNAME = "any", XMLPROJECTION = "ANY") [ SqlFieldName = _any ];

]]></Content>
</UDLText>

When imported and compiled into an Ensemble instance this class works as expected.

When viewed/edited in a development environment we run into issues - the presentation is similar with both Studio and VS Code.

On first viewing in Studio the class source code displays like this:

If you use the extension in VS Code view the class, or export it from there, again the code displays as above (and is saved in this form to the filesystem if exported).

However, if the file is modified and saved in Studio, or modified and saved or even simply compiled (import and compile) in VS Code then the source is serialised and returned to Studio/VS Code by Ensemble as:

From part of a previous conversation with @Brett Saviano  (Request textDocument/documentSymbol failed. Error: name must not be falsy · intersystems-community/vscode-objectscript · Discussion #1530) we understand this serialisation is the correct behaviour.

However, we are left with a few of questions:

  1. Serialisation does not appear to happen when the Ensemble -> System Explorer -> Classes page exports the class - is this correct? (ie present in Ensemble with the comment as '//Property', then the exported class has '//Property' rather than '// Property')
  2. Is this likely to be the same reason that the "InterSystems" tab in VS Code exports the code without the space (they are using the same underlying mechanism)?
  3. Can anyone come with any ways in which classes such as the one attached came to be in our Production Ensemble in the first place?
  4. We tried importing and re-exporting the class using $SYSTEM.OBJ - Load(file, "cuk") to import, and Export(class, file) to export. It did not modify/serialise the class - the '//Property' was left intact.
  5. And finally, is there any way of programmatically forcing this serialisation change and exporting the changed classes - our repo was created with the non-serialised versions of these classes, and now the classes with this issue sporadically show up as "phantom changes" - not relating to the development we are actually attempting to do!  
8 Comments
Discussion (8)4
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 30

Clearing Web Sessions from Terminal

I ran into a situation where VS Code consumed all available web sessions and was unable to get to the Management Console to clear them. I was able to establish a terminal session, though.

Is there a method or routine available through the IRIS terminal that allows one to clear web sessions? I've searched the administration and class documentation and haven't found a solution.

3 Comments
Discussion (3)3
Connectez-vous ou inscrivez-vous pour continuer
Article
· Avr 30 5m de lecture

SQLAchemy-iris avec la dernière version du pilote Python

Après tant d'années d'attente, nous avons enfin un pilote officiel disponible sur Pypi

De plus, j'ai découvert que le pilote JDBC était enfin disponible sur Maven depuis déjà 3 mois,  et le pilote .Net driver - surNuget depuis plus d'un mois.

 La mise en œuvre de la DB-API et que les fonctions devraient au moins être définies par cette norme. La seule différence devrait se situer au niveau de SQL.

Et ce qui est intéressant dans l'utilisation de bibliothèques existantes, c'est qu'elles ont déjà mis en œuvre d'autres bases de données en utilisant le standard DB-API, et que ces bibliothèques s'attendent déjà à ce que le pilote fonctionne.

J'ai décidé de tester le pilote officiel d'InterSystems en mettant en œuvre son support dans la bibliothèque SQLAlchemy-iris.

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 29

What is the REAL content of $THIS (because it seems, $THIS is not always the expected $THIS)?

According to documentation, quotation: "$THIS contains the current class context.
The class context for an instance method is the current object reference (OREF).
The class context for a class method is the current classname as a string value."
 
As my example below shows, either the documentation or the implementation (or both) is wrong, I always call a class method (Value) and expected the class name as the return value but got either the class name or an OREF. Moreover, if I repeat the call, I get another values. But why?
Does anyone have a clear explanation (for an aging brain) or have I misunderstood something?

Class DC.ValueOfThis Extends %RegisteredObject
{

ClassMethod Test()
{
	write $zv,!!
	set obj=..%New()
	do obj.Work()
	write "From classmethod: ",$this," ",$this," ",..Value()," ",..Value()," ",..Value()," ",$this,!
	do obj.Work()
}

Method Work()
{
	write "From inst.method: ",$this," ",$this," ",..Value()," ",..Value()," ",..Value()," ",$this,!
}

ClassMethod Value()
{
	quit $this
}

}

And the test output is:

USER>

USER>d ##class(DC.ValueOfThis).Test()
IRIS for UNIX (Ubuntu Server LTS for x86-64) 2021.2 (Build 649U) Thu Jan 20 2022 08:49:51 EST

From inst.method: 1@DC.ValueOfThis 1@DC.ValueOfThis DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis
From classmethod: DC.ValueOfThis DC.ValueOfThis DC.ValueOfThis DC.ValueOfThis DC.ValueOfThis DC.ValueOfThis
From inst.method: 1@DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis 1@DC.ValueOfThis

USER>
4 Comments
Discussion (4)4
Connectez-vous ou inscrivez-vous pour continuer
Résumé
· Avr 29

A chance to win the InterSystems READY 2025 pass and hotel!

Dear Developer Community member,

There's still time to take part in our developer challenge to win hotel accommodation and free passes to the InterSystems READY 2025!

🎯 Code Your Way to InterSystems READY 2025

Duration: April 21 - May 04, 2025

Task:

  1. Upload an IRIS-based side project to Open Exchange. Be creative - it can be useful, quirky, fun, or just something you've always wanted to try.
  2. Record a short inspirational video (up to 5 minutes):
    • Tell us how InterSystems technologies or the Developer Community impacted your project or career.
    • Explain why YOU should get a ticket to the InterSystems READY 2025.
  3. Submit your video and a link to your app via this form.

>> Full details here

Let's celebrate creativity together. Get ready for the future!