If you want to transfer data via REST check RESTForms project (part 2).
- Log in to post comments
If you want to transfer data via REST check RESTForms project (part 2).
It's actually a wrapper for the same idea - if HeadOfQueue is checked, the resend message is inserted with a higher priority than the highest priority existing queue message. It can be seen in EnQueue method of Ens.Queue class.
Mimedata is subscripted by name and index.
So in your case:
set name = "BulkFileUpload"
for i=1:1:%request.CountMimeData(name)
set mimeData = %request.GetMimeData(name, , i)
}On each iteration mimeData variable would hold the stream with one next mimedata.
%request is simply an object of %CSP.Request class, check the docs or code to know how it works.
Additionally you can use this snippet to see what's inside %request, %response and %session objects:
set %response.ContentType = "html"
do ##class(%CSP.Utils).DisplayAllObjects()
quit $$$OKGreat article!
Here's a relevant article by @Vitaliy Serdtsev on localizing error messages.
<FILEFULL> - Caché attempted to allocate a disk block for more global data or routine storage, but the attempt failed because the Caché database is full and could not be expanded.
Affected db is /hs-connect-hom/db/BPINTEGRADEV-GLB.
Bitmap indices maintain one node per each chunk of 64 000 id's, if at least one id from that range exists. So random integer ids can slow bitmaps down. On the other hand if there are two consecutive but spread (i.e 1..1000 and 100000...110000) id sequences it would generate just 2 global nodes so everything should be ok in that scenario.
Check index global in various scenarios:
Example.Bitmap
Eduard, are you referring to the Priority property of the Ens.MessageHeader class?
Yes.
That seems to be used exclusively for marking the message for Async vs. Synchronous delivery.
These priorities are available:
#define eMessagePriorityHighSync 1
#define eMessagePrioritySync 2
#define eMessagePrioritySimSync 4
#define eMessagePriorityAsync 6Sync by default is 2, so specifying priority 1 may indeed help. Cursory glance at Ens.Queue indicates that messages with priority 1 would be processed first.
While messages do have priority, it seems to be internal property. You can try to check it on a dev system but I'd advise against changing it on a production system.
The easiest way is to have two operations - one for priority source, another for everything else and route messages to one or another operation.
Yes. To get a full list of reserved works execute:
zw ^%qCacheSQL("reservewords")
But this also means that you can't ship the whole vendor copy of the global as you will overwrite the onsite ID counter node.
You can! When you load globals specify /mergeglobal flag to merge the global with existing data instead of overwriting it:
set sc = $system.OBJ.Load("global.xml", "/mergeglobal=1")seed the ID counter at the site to a really high number
Bitmap indices would really slow down from that.
If you're on pre 2019.1 you can use %ZEN.Auxiliary.jsonProvider and %ZEN.Auxiliary.altJSONProvider to convert arbitrary object to and from JSON.
If you're on 2019.1 you can use %JSON.Adaptor class which is similar to %XML.Adaptor.
Error shows that it's access/user error:
ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT
1808 (0x710)
The account used is a computer account. Use your global user account or local user account to access this server.
Cache runs as a service under SYSTEM account.
Check that this user has access to a network drive.
This applies to properties of a class correct? Not just methods?
Correct.
You have several solutions:
The easiest way is to use JSON_OBJECT for everything. Fastest would be just writing to device from resultset. Combine these approaches to get the performance you need (add this code to Parent class and call Test method):
Query Display() As %SQLQuery
{
SELECT
JSON_OBJECT(
'ID':%ID,
'Name': Name,
'Description': Description,
'Children': Example.Parent_GetChildrenInfo(%ID)
)
FROM Example.Parent
}
/// do ##class(Example.Parent).Test()
ClassMethod Test(count = 0)
{
if count>0 {
do ##class(Example.Child).%KillExtent()
do ..%KillExtent()
do ##class(Example.Child).Populate(count,,,,$$$NO)
do ..Populate(count,,,,$$$NO)
}
do ..DisplayFunc().%Display()
}
ClassMethod GetChildrenInfo(id) As %String [ SqlProc ]
{
#define CRLF $c(13,10)
#define ZENJSISNUM(%val) ($IsValidNum(%val)&&(%val=+(%val)))
#define ZENJSNUM(%num) $fnumber(%num,"LON")
#; JSON utility macros that use the JSON translation table instead of the JS translation table
#define ZENJSTABLE(%format) ("JS"_$S(%format["u":"ML",1:""))
#define ZENJSONTABLE(%format) ("JSON"_$S((%format["u"):"ML",1:""))
#define ZENJSONESCAPE(%str,%format) $S(%format["s":$ZCVT(%str,"O",$$$ZENJSONTABLE(%format)),1:$Replace($ZCVT(%str,"O",$$$ZENJSTABLE(%format)),"\'","'"))
#define ZENJSONSTR(%str,%format) (""""_$$$ZENJSONESCAPE(%str,%format)_"""")
#define ZENJSONPROP(%prop,%format) $$$ZENJSONSTR(%prop,%format)
#define ZENJSONVALUE(%val,%format) $S($$$ZENJSISNUM(%val):$$$ZENJSNUM(%val),$C(0)=(%val)||$ListValid(%val):"""""",1:$$$ZENJSONSTR(%val,%format))
#define ZENJSONPAIR(%pr,%val,%format) $$$ZENJSONPROP(%pr,%format)_":"_$$$ZENJSONVALUE(%val,%format)
set out = "["
set ids = ..ChildrenGetStored(id)
set ptr=0
set separator=0
while $listnext(ids,ptr,value) {
set value = $lg(value)
set:separator out = out _ ","
set out = out _ "{"
set out = out _ $$$ZENJSONPAIR("Name",##class(Example.Child).NameGetStored(value),"") _","
set out = out _ $$$ZENJSONPAIR("Description",##class(Example.Child).DescriptionGetStored(value),"")
set out = out _ "}"
set separator = 1
}
set out = out _ "]"
quit out
}I mean how many children parent has on average? 10? 100? 1000?
what's the expected average/max cardinality on that relationship?
I think it would be better to do with REST, but SQLQuery tag can do what you want.
Add
Include Ensemble
to the start of the cube class.
I once separated one Ensemble database (with code and data) into two databases (one db for code, one db for data) on a running system.
It was not difficult actually:
But in my situation the code itself didn't change.
You're calling an Operation, right?
Operations can be called in async mode.
Make the call async and add wait activity?
Another check. Properties can't be SQL reserved words. I often name properties "Date", etc. only to forget that they can't be used in SQL as is only quoted, so I need to go to Class view and rename them to something else.
The main check we need is parametrization. SQL should not be concattenated from user input, but user input should be passed as an argument.
Well, what do you want to do with that list? Depending on your use case, the solution may differ.
For example to get a list of dashboards execute this query:
SELECT *
FROM %DeepSee_Dashboard.DefinitionAnd to get a list of Pivots execute this one:
SELECT *
FROM %DeepSee_Dashboard.PivotAnd in MDX2JSON project I need to get a list of dashboards visible to the current user. I use custom result set for that (because user may have access to dashes but not to SQL).
And Tuesday, April 23rd at 11am EDT we would be running an English version of the webinar.
If it's possible restart the DR Mirror. WIJ should be recreated on startup.