go to post Robert Cemper · Dec 12, 2018 Software caused connection abortAs you didn't supply many details the is more than 1 reasonyou have a network problem connecting to your live serveryour live server hs not enabled ODBC accessthe account you use has no access privilegesyour GCT.PA_Data is so big or untuned that you fall into a connection timeout.Try to run your query on the live server and see its performance.Try a simple query like "SELECT top 3 field1,field2 FROM GCT.PA_Data2" just to see if you have access rights at all.
go to post Robert Cemper · Dec 11, 2018 Your Caché installation has an example in namespace SAMPLEShttp://localhost:57772/csp/samples/websocketdemo.cspIt works in synchronous mode.WebSocket SampleThis sample uses the WebSocket protocol to communicate with the server.Note that it requires a web server compatible with web sockets and the browser also support web sockets,so the following versions or later IE10, Firefox 11, Chrome 16 Safari 6, Opera 12.
go to post Robert Cemper · Dec 11, 2018 I used Caché default login page as an example as it is a very easy one to serve.http://localhost:57772/csp/sys/%25CSP.Login.clsTake a look to YOUR login page to see if you really want to do this.First, you do the Get() to fetch your login page USER>Write oReq.Get("csp/sys/%2525CSP.Login.cls"),! ZWRITE oReq 1 oReq=<OBJECT REFERENCE>[1@%Net.HttpRequest] +----------------- general information --------------- | oref value: 1 | class name: %Net.HttpRequest | reference count: 2 +----------------- attribute values ------------------ | AcceptGzip = 1 <Set> | (BinaryContent) = 1 |(Cookies("127.0.0.1","/","CSPWSERVERID")) = $lb("144BiVjd","",0) |(Cookies("127.0.0.1","/","CacheBrowserId")) = $lb("fCl8qBvDJnIKcns4iOsFlw--","",0) |(Cookies("127.0.0.1","/csp/sys","CSPSESSIONID-SP-57772-UP-csp-sys-")) = $lb("001000010000G5M1GDe9SeGk57MvZN91AeLNZ1wkcwbfb5gBQs","",0) | (Device) = "|TCP|36057801" | (DeviceState) = $lb("127.0.0.1",57772,"",8080,"","0","",0) | (ErrorOnNextOpen) = 0 | FollowRedirect = "" | ForceReuseDevice = 0 | HTTPVersion = 1.1 | (Headers) = 5 |(Headers("ACCEPT-ENCODING")) = "gzip" |(Headers("ACCEPT-ENCODING",0)) = "Accept-Encoding" |(Headers("ACCEPT-ENCODING",1)) = 3 |(Headers("ACCEPT-ENCODING",2)) = "" | (Headers("HOST")) = "127.0.0.1" |(Headers("HOST",0)) = "Host" |(Headers("HOST",1)) = 2 |(Headers("HOST",2)) = "" |(Headers("REFERER")) = "http://127.0.0.1:57772/csp/sys/%2525CSP.Login.cls" |(Headers("REFERER",0)) = "Referer" |(Headers("REFERER",1)) = 4 |(Headers("REFERER",2)) = "" |(Headers("USER-AGENT")) = "Mozilla/4.0 (compatible; Cache;)" |(Headers("USER-AGENT",0)) = "User-Agent" |(Headers("USER-AGENT",1)) = 1 |(Headers("USER-AGENT",2)) = "" | Https = 0 | LocalInterface = "" | Location = "csp/sys/%2525CSP.Login.cls" <Set> |NoDefaultContentCharset = 0 | OpenTimeout = "" | Password = "" | Port = 57772 <Get> | PostGzip = 0 | ProxyHTTPS = 0 | ProxyPort = 8080 | ProxyServer = "" | ProxyTunnel = 0 | ReadRawMode = 0 | RecChars = 2262 | (RedirectNo) = 0 |RequestHeaderCharset = "UTF-8" | ResponseStream = "" | ReturnGzipResponse = 1 | SOAPBuffering = "" |SSLCheckIdentityInternal = "" |SSLCheckServerIdentity = 1 | SSLConfiguration = "" | SSLError = "" | SentChars = 354 | SocketTimeout = 115 | TTFC = .00366 | TTLC = .005715 | (TimeLastUsed) = 5615429668.294 | Timeout = 30 | Username = "" | WriteRawMode = 0 | WriteTimeout = -1 +----------------- swizzled references --------------- | i%EntityBody = "" <Set> | r%EntityBody = "2@%Library.GlobalBinaryStream" <Set> | i%HttpResponse = "" | r%HttpResponse = "3@%Net.HttpResponse" +--------------- calculated references --------------- | Authorization <Get,Set> | ContentCharset <Get,Set> | ContentEncoding <Get,Set> | ContentLength <Get> | ContentType <Get,Set> | Date <Get,Set> | From <Get,Set> | IfModifiedSince <Get,Set> | Pragma <Get,Set> | ProxyAuthorization <Get,Set> | Referer <Get,Set> | Server <Get,Set> | UserAgent <Get,Set> +----------------------------------------------------- - Next you refer to the response and get all Headers and Cookies USER>s oRes=oReq.HttpResponse ZW oRes oRes=[3@%Net.HttpResponse] +----------------- general information --------------- | oref value: 3 | class name: %Net.HttpResponse | reference count: 3 +----------------- attribute values ------------------ | ContentBoundary = "" | ContentInfo = "charset=utf-8" | ContentLength = 1841 | ContentType = "text/html; charset=utf-8" | Data = "4@%Stream.FileCharacterGzip" |Headers("CACHE-CONTROL") = "no-cache" |Headers("CONTENT-ENCODING") = "gzip" |Headers("CONTENT-LENGTH") = 1841 |Headers("CONTENT-TYPE") = "text/html; charset=utf-8" | Headers("DATE") = "Tue, 11 Dec 2018 09:34:28 GMT" | Headers("EXPIRES") = "Thu, 29 Oct 1998 17:04:19 GMT" | Headers("PRAGMA") = "no-cache" | Headers("SERVER") = "Apache" |Headers("SET-COOKIE") = "CSPSESSIONID-SP-57772-UP-csp-sys-=001000010000G5M1GDe9SeGk57MvZN91AeLNZ1wkcwbfb5gBQs; path=/csp/sys/; httpOnly;,CSPWSERVERID=144BiVjd; path=/; httpOnly;" | HttpVersion = "HTTP/1.1" | ReasonPhrase = "OK" | StatusCode = 200 | StatusLine = "HTTP/1.1 200 OK" +----------------------------------------------------- Finally you access the page you got (a GZ Stream) USER>set oData=oRes.Data ZW oData oData=<OBJECT REFERENCE>[4@%Stream.FileCharacterGzip]+----------------- general information ---------------| oref value: 4| class name: %Stream.FileCharacterGzip| %%OID: $lb("C:\InterSystems\Cache\mgr\Temp\7KrzEUaFJT0zvA.http","%Stream.FileCharacterGzip","")| reference count: 3+----------------- attribute values ------------------| (%Concurrency) = 1| %Location = "" <Set>| (%LockRef) = ""| (%Locked) = 0| AtEnd = 0| BOM = ""| (CurrFile) = ""| Id = "C:\InterSystems\Cache\mgr\Temp\7KrzEUaFJT0zvA.http" <Set>| LineTerminator = $c(13,10) <Set>| (MakePermLoc) = 0| (Mode) = 1|(NormalizedDirectory) = "C:\InterSystems\Cache\mgr\Temp\"|(OidTranslateTable) = "UTF8"| (ReadMode) = 0| ReadSize = ""| RemoveOnClose = 1| (StoreFile) = "7KrzEUaFJT0zvA.http"| StreamFormatWrite = 1| (TempFile) = ""| TranslateTable = "UTF8" <Set>| UseVMSVersion = 0| (VariableRecord) = 0+--------------- calculated references ---------------| CanonicalFilename <Get>| Filename <Get,Set>| LastModified <Get>| Size <Get>+----------------------------------------------------- and this is your page USER>do oData.OutputToDevice()<html><head> <title>Anmeldung 'LOCAL'</title><script language="javascript"> // called when page is loaded function pageLoad() { // see if we can give focus to the UserName field: if (self.document.Login && self.document.Login.CacheUserName) { self.document.Login.CacheUserName.focus(); self.document.Login.CacheUserName.select(); } return true; } </script> <style type="text/css">body { background: rgb(232,231,226); filter: progid:DXImageTransform.Microsoft.gradient(GradientType='0', startColorstr='#e8e7e2', endColorstr='#e0d9d9'); background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0,rgb(232,231,226)), color-stop(0.5,rgb(242,241,236)), color-stop(1.0,rgb(232,231,226))); background: -moz-linear-gradient(top, rgb(232,231,226), rgb(242,241,236),rgb(222,221,216)); background: linear-gradient(top, rgb(232,231,226), rgb(242,241,236),rgb(222,221,216)); ; overflow: hidden;} input { ;} table.LayoutTable { background: white; width: 98%; border: 2px solid black;} .portalTitle { width: 100%; height: 60px; position: relative; } .portalTitleInfoBox { left: 20px;} .portalTitleInfoLabel { padding-left: 40px; font-size: 9pt; color: #606060; text-align: left;} .portalTitleInfoVal { font-size: 9pt; color: black; text-align: left; font-weight: bold;} table.login { ; border: rgb(138,138,138) solid 1px; opacity: 1.0; border-radius: 5px; background: rgb(237,236,228); -moz-border-radius: 5px; filter: progid:DXImageTransform.Microsoft.gradient(GradientType='0', startColorstr='#e8e7e2', endColorstr='#e0d9d9'); background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0,rgb(232,231,226)), color-stop(0.5,rgb(242,241,236)), color-stop(1.0,rgb(232,231,226))); background: -moz-linear-gradient(top, rgb(232,231,226), rgb(242,241,236),rgb(222,221,216)); background: linear-gradient(top, rgb(232,231,226), rgb(242,241,236),rgb(222,221,216)); } table.login td.loginCaption { filter:alpha(opacity=100); opacity: 1.0; color: rgb(67,67,67); ; font-size: 11px; text-align: left; padding-left:20px;} table.login td.loginInput { border: rgb(165,172,178) 1px solid;} /* Logout message */h3 { color: rgb(67,67,67); ; font-size: 12px; font-weight: bold;} div.loginPrompt { color: #D0D0D0; font-size: 16pt; padding: 0px; padding-bottom: 5px; text-align: center; text-shadow: black 1px 1px 1px;} div.isc { color: #808080; font-size: 10pt; padding-top: 2px; text-shadow: #6374AB 1px 1px 1px;} .portalLogoBox { position: static; padding: 10px; padding-bottom: 4px; padding-right: 30px; text-align: center;} .portalLogo { color: rgb(53,107,141); position: relative; font-weight: bold; font-size: 12pt; top: 0px; right: 0px; border: 2px solid rgb(53,107,141); padding: 2px; padding-left: 5px; padding-right: 5px; -moz-border-radius: 4px; border-radius: 4px; background: #E0E0F0;}.portalLogoSub { position: relative; color: #808080; font-size: 8pt; top: 3px; right: 0px;}.loginlink { color: rgb(52,108,141);}.button { background: rgb(52,108,141); color: white; ; font-size:10px; text-transform: uppercase; text-decoration: none; font-weight: bold; padding: 3px; padding-left: 8px; padding-right: 8px; -moz-border-radius: 5px; border-radius: 5px; border-top: 1px solid lightgray; border-left: 1px solid lightgray; border-right: 1px solid gray; border-bottom: 1px solid gray; cursor: pointer;}.button:hover { background: rgb(53,107,141); color: white; background-image: url(portal/button_hover.png); background-repeat: repeat-x;}</style></head> <body style="background-color:rgb(232,231,226);" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="pageLoad();"><table class="portalTitle" id="group_1" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr valign="bottom"> <td width="99%" align="left"> <div class="portalTitleInfoBox"> <table border="0"> <tr> <td class="portalTitleInfoLabel">Instanz:</td><td class="portalTitleInfoVal">LOCAL </td> </tr> </table> </div> </td> <td width="10%" align="right" valign="top"> <div class="portalLogoBox"> <div class="portalLogo" title="Powered by Zen">Caché</div> <div class="portalLogoSub">by InterSystems</div> </div> </td> </tr> </table><tr><td><table border="0" cellpadding="10" align="center" class="LayoutTable"> <tr> <td align="center"> <table border="0" class="LayoutMain" width="100%" cellpadding="5" cellspacing="0"><tr><td style="height:90px;"><br/></td></tr><tr><td><center> <form name="Login" method="post" action="/csp/sys/%2525CSP.Login.cls"> <table class="login" style="background-color:rgb(232,231,226);" border="0" cellspacing="6" cellpadding="2" > <tr valign="bottom"> <td nowrap class="loginCaption">User Name</td> <td style="padding-top:18px;padding-right:20px;"><input type="text" size="30" name="CacheUserName" class="loginInput" value=""/> </td> </tr> <tr valign="bottom"> <td nowrap class="loginCaption">Kennwort</td> <td><input type="password" size="30" name="CachePassword" class="loginInput"/> </td> </tr> <tr><td> </td> <td style="padding-bottom:10px;"><input type="submit" name="CacheLogin" class="button" value="Anmeldung"></td> </tr> </table> </form></center></td></tr><tr><td style="height:180px;"><br/></td></tr></table></body></html> - I have marked "CacheUserName" , "CachePassword" that you have to submit for Login.
go to post Robert Cemper · Dec 11, 2018 I did something similar in past. %Net.HttpRequest is the right wayYou have to mimic a browser and have to find the right Form and Input tags to fill USER and PW typically.The risk you have:- you may get a awfull amount of JS and CSS stuff.- If it isn't a classic form you may need to reverse engineer all the dynamics behind (like a browser).It may end up with a very tricky coding exercise.
go to post Robert Cemper · Dec 10, 2018 Changing the rules during a competition is a very bad idea.Participating in a game includes accepting the published and know rules. Accept it or run a different game.Even my grand-children starting from 5 understand this.
go to post Robert Cemper · Dec 5, 2018 Check if your schema is really homed in the DB that is mirrored.If it is mapped from a different DB / Namespace the mirror setting of the home DB applies.Also check mapping settings for both sides.Mapping is stored in namespace"%SYS" which typically not participates any mirror.[ just had a similar experience a few weeks ago ]
go to post Robert Cemper · Dec 3, 2018 If you can fix it by using %routeList instead of routeList you see a problem around variable scoping.see this Summary on Local Variable Scoping
go to post Robert Cemper · Dec 3, 2018 If you don't define an explicit MAXLEN it is just ignored during validation.But you may run into problems with ODBC/JDBC when your VARCHAR or similar just has no maximum SIZE.So you might instead store your super-long-string into a GlobalStream But then you lose all string related operations. It's an option I personally dislike.
go to post Robert Cemper · Dec 2, 2018 Hi,I had to prepare a suitable filePrevious case: Open Param "RU" /UNDEFINED ignores line terminators USER>open file:("RU":1000000) USER>use file read x use 0 write $l(x) 164405 USER>write $e(x,*-30,*) e></xs:complexType></xs:schema> USER>close file With open Param "RS" /STREAM line terminators are honored USER>open file:(<span style="color:#c0392b;"><strong>"RS"</strong></span>:1000000) s l=0 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 4126 4126 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 18433 22559 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 61497 84056 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 80343 164399USER>write $e(x,*-30,*) e></xs:complexType></xs:schema> USER>close file The difference in lenght results from skipped line terminators.
go to post Robert Cemper · Dec 2, 2018 Hi,I just tried this : USER>set file="Eduard.txt" USER>open file:("RU":1000000) USER>use file read x#1000000 USER>write $length(x) 183237 USER> "RU":Reclen seams to do the trick I used it in READ just as fallback. The content was as expect.
go to post Robert Cemper · Nov 20, 2018 There's still the option to place an enhancement request @WRC.If granted, version 2019.2 more likely 2020.* or after may include it. Until then you depend on own writing.
go to post Robert Cemper · Nov 20, 2018 you may try what works in pure CachéZNamespace"%SYS" DO INT^SHUTDOWN
go to post Robert Cemper · Nov 20, 2018 There is no option 'NO_JSON' or similar for strings.so you have to do it by hand.Assumption according to your description the basic table looks like this: (except for Name)select ID, Name, Options from Whatever.WhateverIDNameOptions1Zucherro,Michelle Q.{"Color":"Green","Count":4}2Paraskiv,Alexandra E.{"Color":"Purple,""Count":6}3Ramsay,Jules T.{"Color":"White""Count":8}4Grabscheid,Julie K.{"Color":"Orange","Count":2}5Edwards,Mark S.{"Color":"Red","Count":1}Then this might do the trick:You manually mask out the critical characters first and mask it in after JSON Processing.No help by the system just your own fate.SELECT top 5 ID, REPLACE(REPLACE(REPLACE(JSON_OBJECT('ID':ID,'Name': Name,'Options': $TRANSLATE(Options,'{}"','()^') ),'"(','{'),')"','}'),'^','"')FROM Whatever.Whatever 1{"ID":1,"Name":"Zucherro,Michelle Q.","Options":{"Color":"Black","Count":7}}2{"ID":2,"Name":"Paraskiv,Alexandra E.","Options":{"Color":"Red","Count":1}}3{"ID":3,"Name":"Ramsay,Jules T.","Options":{"Color":"Purple","Count":6}}4{"ID":4,"Name":"Grabscheid,Julie K.","Options":{"Color":"Green","Count":4}}5{"ID":5,"Name":"Edwards,Mark S.","Options":{"Color":"White,""Count":8}} Not funny but workingYou could as well compose your 'personalized' JSON result in a Classmethod and project it as SqlProcedure
go to post Robert Cemper · Nov 19, 2018 for display in terminal:ZWRITE ^PeopleorZWRITE ^People("Customers")orZWRITE ^People("Customers", "Acc.divison")depending on your needs
go to post Robert Cemper · Nov 16, 2018 I'm really surprised by this discussion.Especially having actual numbers. What should mean 6400 with just 15000 rows in total? Sorry, I oppose!It's a matter of selectivity. If you can collect 2% of your records or more by a single value, then a BITMAP makes sense.Even EXTENTTbitmap that filters Exists or Not falls into this rule. Though this isn't really property based.
go to post Robert Cemper · Nov 14, 2018 1) YES, you can! And it will not affect stability and usability. Though understanding COS is definitely an advantage in understanding what is going on. Similar to all other DBs: Understanding concepts and internals is always a benefit. Other DBs are just not as open to investigation and not as flexible doing the "undoable".2a) Importing and running a Caché DB into IRIS works for 98% at least.For the remaining 2%, ISC engineers are very open to assist you and solve the issue.2b) Converting COS to anything else depends mostly on the COS code you have in hands. I know of no converter to do it for you.As COS allows coding style that was used 40yrs back the range of styles is a very broad and unpredictable field without touching it.#1 You depend on the quality of external documentation.#2 You depend on inline documentation, comments, remarks in code. This can be excellent or just not existing, #3 You depend on how tricky the code is designed and written.At that point just knowing COS might not be enough and even experts could get their headache on what I call "dirty coding". #4 ISC has experts also to read and understand old style and its side effects.#5 You have this bright community to ask.#6 You have excellent online training facilities to learn COS. I've done this with ~12 people over the last few years.If they understand Objects, SQL, Java (or generic OO programming concepts) it's a matter of a few weeks to be inside COS.And they have to be willing to break out and see something new with other limits and other possibilities other horizons.HTH
go to post Robert Cemper · Nov 13, 2018 quick hint:use %String (MAXLEN="") ; to get your full names in.
go to post Robert Cemper · Nov 13, 2018 The key issue in a DR scenario is network performance between the instances.You will run most likely an Async Mirror to have a reasonable distance between production and DR site.I wouldn't suppose enough bandwidth for a sync Mirror.The other issue is the performance of the DR site. You require enough performance to process all the synchronization within a reasonably short delay. This is often underestimated, Production servers grow and leave their DR site behind.Not specific to the cloud but not less important: How can you verify that the content of your DR site is really identic to your production.For a heavy transactional operation, this can be a real tricky exercise.And last not least if you don't train your team for a disaster situation and verify your instructions step by step at least once a year all your investment could be wasted money.Especially this last point is skipped quite often as it means in most cases a lot of effort with no immediate ROI.