Danny Wijnschenk · Apr 9, 2017 go to post

And if you want to make your own prompt, you could even use your own Shell routine :

Shell ;
    For {
        Try {
            Write !,$$Prompt()
            Read cmd Write !
            Xecute cmd
        } Catch {
            Write $ZE,!
        }
        If ($ZCVT($G(cmd),"U")="QUIT") Quit
    }
    Quit
Prompt() ;Create your own prompt here !
    New prompt
    Set prompt = $ZDate($H,4)_" - "_$ZTime($P($H,",",2))_" > "
    Quit prompt
Danny Wijnschenk · Apr 26, 2017 go to post

If you did not install Caché with minimal security, make sure your Caché user has sufficient privileges in Caché to run $ZF(-1 : you need the %System_CallOut resource.

Danny Wijnschenk · Apr 28, 2017 go to post

If the restore succeeded on a Caché 2015 installation, it might be easier to copy the cache.dat's from that version to your 2016 installation! (what was the version of the original backup).

Without detailed info it is hard to find the exact cause (cache.cpf, cconsole.log), connect me directly or  mail support@intersystems.com if you cannot find a work around.

Danny Wijnschenk · Jul 18, 2017 go to post

Make sure you don't assign more memory than the available physical memory : your OS will swap to the hard disk which will cancel the benenefits of global buffers.

Danny Wijnschenk · Sep 14, 2017 go to post

Quick & Dirty : You could copy the cache.dat, and delete in one all routines and in the other all globals.

(but you might end up with a routines DB which has too much free space...)

Danny Wijnschenk · Oct 22, 2017 go to post

put your code in a try {  } catch { } block to prevent that Cache will not start if there are errors in your code

Danny Wijnschenk · Oct 31, 2017 go to post

You will always need to add the property and an entry in the storage section of the mapped class.

If you include the class source and global entry, we can help you in more detail.

Danny Wijnschenk · Nov 3, 2017 go to post

hi Dmitry,

i gladly take your hints, this is precisely the goal of this article series : to comment and discuss code and make it better or point out alternative code.

Using streams is to be preferred over the Open command (like showed in Bert's code), you can see the age difference in comparing our code !

I limit the use of standalone Else to checking a timeout.

For example:

Lock +^MyLock("MyBatch"):1 Else  Quit "job is already running"

which is identical to 

Lock +^MyLock("MyBatch"):1
If '$Test {
    Quit "job is already running"
}
Danny Wijnschenk · Nov 11, 2017 go to post

Your use of Set $listbuild was unknown to me : i only used it on the right hand side (like Set var = $lb(...) ), but on the left-hand side, it is ideal to set a bunch of variables in the same instruction, cool !

Danny Wijnschenk · Jan 25, 2018 go to post

Besides all that is mentioned, the If without braces has a side-effect that the If with braces does not have : it affects the system variable $Test.

USER>set $test=0
 
USER>w $test
0
USER>if 1=1 { write "one" }
one
USER>w $test
0
USER>if 1=1 write "one"
one
USER>w $test
1
USER>

Not important, only if you use the ELSE (legacy) command...

Danny Wijnschenk · Jan 25, 2018 go to post

Yes, same here, i also use following code a lot:

Open <some device>:"R":0 Else  Write "could not open device" Quit

I always use Else on the same line just after the command that changes $test,

having too much instructions between them creates problems. 

Danny Wijnschenk · Jan 31, 2018 go to post

In the real world, there are lots of programs still using this style, every developer using Caché Object Script should be able to read this and understand the side-effects, pitfalls, even if we recommend to not use it anymore... 

Danny Wijnschenk · Aug 16, 2018 go to post

If Caché Auditing is enabled, you can check the login failure messages to see if  the problem is a disabled user or wrong username/password.

(Auditing can be enabled in Caché portal ->  system admin -> Security -> Auditing -> Enable Auditing.

Use 'configure Auditing events' to enable Login Failure messages.

Danny Wijnschenk · Aug 21, 2018 go to post

Do you have a user with the %ALL Role to check if the problem is user-based, 

if that user cannot login either, it could be that some services are disabled.

Again, you can know for sure by enabling auditing and look at the login failures.

Danny Wijnschenk · Jan 20, 2019 go to post

We will finalize the agenda for the Caché User Group @BeneluxSymposium shortly.

All questions or suggestions for demos or presentations you want to do are still welcome here or at CUG Benelux Blog

Danny Wijnschenk · Jun 26, 2019 go to post

You cannot pass an object (oref) as a parameter using Job.

You have to save its properties to a variable/array and pass that, or save the object and pass its id.

Danny Wijnschenk · Jul 15, 2019 go to post

Hi Jimmy,

I think the Send* methods have an extra argument where you can specify the REST type (GET, PUT or POST), and the methods with the Get, Put or Post in the names are just shortcuts that internally call the Send method. (This is true in the %Net.HttpRequest class, so i guess it is the same in the adapter)

The SendFormDataArray and SendFormDataUrl have also an extra argument where you can pass  a %HttpRequest instance. So you could create this instance to pre-populate properties that are not possible to set using the adapter, like the ContentType property.

Set objHttpRequest ##class(%Net.HttpRequest).%New()
Set objHttpRequest.ContentType "application/json"
Set tSC=..Adapter.SendFormDataURL(tURL,.tHttpResponse,"POST",objHttpRequest,,pRequest1.%ToJSON()).
 

I haven't tested this code (don't have Ensemble) but looking at the docs it should work.

Danny Wijnschenk · Jul 25, 2019 go to post

Hi Vitaliy,

This is the same as 'write $SYSTEM.INetInfo.EthernetAddress(0)' in recent versions.

As said we prefer to not use $zu anymore, but since availability of  the helper classes depend on what version is used, $zu might be the only possibility unless they upgrade.

Danny Wijnschenk · Jul 25, 2019 go to post

Hi John,

I tried to create the classes you are describing, and they seem to give the correct results in the two SQL statements.

The two query plans are also giving the same access path.

Can you tell me what the outcome (data/error) of the second SQL statement is giving you ? 

I used following classes :

Class User.immst Extends %Persistent
{
Relationship PhysicalRecord As User.pytrn [ Cardinality = many, Inverse = ItemRecord ];
Property imdesc As %String;
}

Class User.pytrn Extends %Persistent
{
Relationship ReportRecords As User.pyrpt [ Cardinality = many, Inverse = PhysicalRecord ];
Relationship ItemRecord As User.immst [ Cardinality = one, Inverse = PhysicalRecord ];
Property pypqty As %String;
}

Class User.pyrpt Extends %Persistent
{
Relationship PhysicalRecord As User.pytrn [ Cardinality = one, Inverse = ReportRecords ];
Property pypqty As %String;
}

 
Danny Wijnschenk · Jul 26, 2019 go to post

Hi John,

Can you show me your class definitions, because when i execute the second SQL on my classes and some random data, it will show the results i expect :

(maybe you need to re-index your tables)

Danny Wijnschenk · Aug 18, 2019 go to post

I prefer option 3 as the other options only makes your code more unreadable.

We could use <GLOBAL>^MyGlobal</GLOBAL> in the documentation, and write some script to generate a summary page of all classes that point to this global...

Danny Wijnschenk · Sep 22, 2019 go to post

Hi Gunwant,

can you show us the postman screenshot, and your resthandler class.

It will be much easier for the community to solve your problem with this info, than having to guess,

Friendly Regards

Danny Wijnschenk · Oct 19, 2019 go to post

There is no general answer if it is possible : it depends on the application : I have done conversions in a few  hours, but had also conversions that took a lot longer or were impossible without heavy rewrite of code.

Depends on :

- use of OS-dependencies (VMS/VAX) like working with files/devices or print operations

- use of 'non-standard' Mumps syntax, or relying on specific formats of special variables

- use of  DSM-11 tools (like DASL) or OS tools

- available source code

- ...