Eduard Lebedyuk · Jan 9, 2019 go to post

All possible job states (from EnsConstrains.inc):

  • $$$eJobStatusStarting
  • $$$eJobStatusRegistered
  • $$$eJobStatusVisiting
  • $$$eJobStatusRunning
  • $$$eJobStatusDeQueuing
  • $$$eJobStatusQuiescent
  • $$$eJobStatusError
  • $$$eJobStatusHalted
  • $$$eJobStatusTerminated
Eduard Lebedyuk · Jan 8, 2019 go to post

In the future please don't combine separate questions into one post.

I am looking for a way to detimerine if a certain namespace is ensemble enabled.

To check that some <namespace> has Ensemble enabled call:

write ##class(%EnsembleMgr).IsEnsembleNamespace(<namespace>)

where <namespace> defaults to current namespace.

Log some information to the console log file with a certain error level.

%SYS.System class provides the WriteToConsoleLog method, which you can use to write to the cconsole.log file.

Eduard Lebedyuk · Jan 5, 2019 go to post

Use %Stream.GlobalBinary to pass streams without saving them on disk. Also use Ens.StreamContainer as an interoperability message class.

If you used %Stream.TmpBinary class to hold your stream, it would not be saved.

Eduard Lebedyuk · Jan 4, 2019 go to post

If you have SSL config named, say, "AWS" try to set SMTP SSLConfiguration setting to "AWS*" (with asterisk on end). It can help.

Eduard Lebedyuk · Jan 4, 2019 go to post

Click "Visual Trace" link to view details.

In your case there's 403 error, so you're not authenticated.

Check this topic for AWS authorization options.

Eduard Lebedyuk · Jan 4, 2019 go to post

- If I have a global available in a certain namespace, can I use InterSystems SQL to query those globals?  

- How do existing globals and creating classes work?  Like I have a Person global right now.  Can I turn that into a class and manipulate the data that way?

You'll need class mapping to query globals via SQL. Check article series  The Art of Mapping Globals to Classes by @Brendan.Bannon.

- I'm used to Java where you can write a class and then write a driver class to test your classes and methods. Or simply just test your newly created classes and methods in the main method (wherever that lies in your code).  Is there something similar in Studio?  I can write classes but then they are compiled and I have to go to the terminal and test them?  Is this where routines come into play in Studio?

You can configure Studio or Atelier debugger to run any class method. There's no need to use routines for that.

Eduard Lebedyuk · Dec 27, 2018 go to post

The input pattern is not constant, it's just an example.

I'd rather avoid parsing my input pattern and translating it into Cache pattern.

Eduard Lebedyuk · Dec 25, 2018 go to post

Thanks for the info, Fabian.

I myself am a fan of Ubuntu  structure, do you know how to get that automatically on other OSes, primarily CentOS?

Eduard Lebedyuk · Dec 24, 2018 go to post

While spawning a process on Windows can be (and usually is) costly, linux offers better performance in that regard.

Additionally ImageMagick offers two C APIs: High-level and Low-Level they could be used to write a callout library, which would likely offer the best performance.

Eduard Lebedyuk · Dec 20, 2018 go to post

Great game!

Does not work, as object with that ID does not exist

zw ##class(OPNLib.Game.ConwayLifeGame).Test()
 
These are the settings for the test:
{"ID":1,"From":0,"To":200,"Iterations":200,"InitialConfig":5,"Rows":80,"Columns":150,"Vector0":"1,1","VectorN":"100,40"}
Press any key to continue... (Ctrl-C to stop)"0 "_$lb($lb(5002,"zCreateFromStatus+8^%Exception.StatusException.1 *tInfo(1,""code"")",,,,,,,,$lb(,"USER",$lb("^zCreateFromStatus+8^%Exception.StatusException.1^1","e^zThrowIfInterrupt+7^%Exception.StatusException.1^1","e^zTest+12^OPNLib.Game.ConwayLifeGame.1^2","e^^^0"))))/* ERROR #5002: Cache error: zCreateFromStatus+8^%Exception.StatusException.1 *tInfo(1,"code") [zTest+12^OPNLib.Game.ConwayLifeGame.1:USER] */

I added this code after read and it works:

If ..%ExistsId(pTest.ID) {
set g = ##class(OPNLib.Game.ConwayLifeGame).%OpenId(pTest.ID)
} else {
set g = ##class(OPNLib.Game.ConwayLifeGame).%New()
}
Eduard Lebedyuk · Dec 19, 2018 go to post

Check Dir method of %Net.SSH.SFTP class, it returns directory contents, including sub-directories.

Eduard Lebedyuk · Dec 19, 2018 go to post

If you're using InterSystems IRIS try this connection string (replacing values with appropriate):

"Driver=InterSystems ODBC Driver;Host=127.0.0.1;Port=56772;Database=USER;UID=myUsername;PWD="

and for Caché/Ensemble try (driver name could be InterSystems ODBC):

"Driver=Cache ODBC Driver;Host=127.0.0.1;Port=1972;Database=USER;UID=myUsername;PWD="

If the problem persist, check Audit log.

Eduard Lebedyuk · Dec 16, 2018 go to post

Thank you, Dmitry, I used Process Monitor to get relevant error:

Turns out dependent DLLs should be in bin folder or current folder, but not in callout library folder.

Eduard Lebedyuk · Dec 16, 2018 go to post

when you get the error <DYNAMIC LIBRARY LOAD>, you should look at cconsole.log (or messages.log for IRIS), where you may find code of error.

Thank you. Got this error

Error loading dll (c:\users\eduard\eclipse-c-workspace\helloworld\debuglib\libhelloworld.dll) is 126

It is possible that you build it for 32bit, but uses in 64bit instance.  In this case, you will get the error with code 139. if you got other code, you can google it.

I can get it to work if I compile it without a few lines, so I'm sure it's 64bit.

Eduard Lebedyuk · Dec 15, 2018 go to post

ObjectScript method:

WRITE $SYSTEM.SQL.CONVERT(expression,convert-to-type,convert-from-type)

is equal to SQL Convert function.

Eduard Lebedyuk · Dec 13, 2018 go to post

If that doesn't work too, try

SELECT 1

If it fails - connection/config problems.

If it succeeds it's something else.

Eduard Lebedyuk · Dec 12, 2018 go to post

%ObjectToJSON writes stream to current device. You need to write to stream:

set oMetadata = ... /// metadata is from ADT message which is dynamic object
set stream = ##class(%Stream.GlobalCharacter).%New()
set tSC = ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(stream, oMetadata)
quit:$$$ISERR(tSC) tSC
set request = ##class(Ens.StreamContainer).%New(stream)
set tSC = ..SendRequestAsync(..JSONOperation,stream,0,,..MetadataContext)  /// send the stream to operation 

And your JSONOperation should be able to accept messages of Ens.StreamContainer class.

I just checked Ens.BusinessService:SendRequestAsync signature and it's:

Method SendRequestAsync(pTargetDispatchName As %String, pRequest As %Library.Persistent, pDescription As %String = "") As %Status
So maybe the last line should be just:

 set tSC = ..SendRequestAsync(..JSONOperation, stream)

Finally, use %ZEN.Auxiliary.altJSONProvider instad of %ZEN.Auxiliary.jsonProvider. It's faster.

Eduard Lebedyuk · Dec 11, 2018 go to post

At the very least changes in:

  • Query elements of any class
  • ClassMethods with [SqlProc] modifier

May require a query purge.

Eduard Lebedyuk · Dec 11, 2018 go to post

It could be easier just to log what client serves to a server in a form and do the same in objectscript.