Chad Severtson · May 17, 2016 go to post

The version of the documentation should be clearly displayed as there are differences between the respective versions (and not just in appearance). 
The ordering of the sidebar is confusing to the point that I find it distracting. 

Chad Severtson · Aug 1, 2016 go to post

The biggest question will be whether or not you have any sensitive information stored outside of Ensemble. 

Please note with Caché/Ensemble Encryption there is no backdoor. 

Chad Severtson · Nov 4, 2016 go to post

The command $SYSTEM.SQL.DATEDIFF(outputFormat, start, end) is also quite useful for date arithmetic. It is a lot less picky about the format and a lot more powerful regarding the output. 

Chad Severtson · Aug 1, 2016 go to post

When a language isn't strongly typed, I often test unexpected but possible types -- for example: Numbers or Strings instead of Dates or Booleans. 

Other favorites: 

  • ""
  • "null"
  • "undefined" 
  • Quotes, comments, and other injection attack patterns. 

As Jon Willeke suggested, I also use random data when possible (apart from the -1, 0, 1 defaults).  The %Library.PopulateUtils class can be helpful for generating other preformatted random information. 

Chad Severtson · Dec 15, 2022 go to post

This is an excellent article Murray! Thanks for putting it together. It was exactly what I needed for a conversation this morning. 

Chad Severtson · Apr 12, 2023 go to post

It has been around for a few years.
Personally, I hesitate to use the alias capability lest I find myself in an environment without them! 

Chad Severtson · Apr 12, 2023 go to post

Consider $System.OBJ.ExportToStream() and .LoadStream() to avoid local files with a change to the appropriate implicit namespace between. 

Chad Severtson · Apr 25, 2023 go to post

I plan to delete this article the second that the version containing Stochastic Sampling is installed everywhere. In the meantime, I can think of a few customers that need alternatives. 

Your SQL utilities are great and also available via Open Exchange

Chad Severtson · Jun 30, 2023 go to post

Thanks for the feedback. We made sure that the product teams heard your perspective.

There is a button somewhere in the new rules editor for switching back to the old one. System wide, you can also disable the web application for the new rules editor. 

We expect that the old ZEN based rules editor will be deprecated eventually. However, there are plenty of enhancements to the new in the pipeline based on valuable feedback like this. 

Chad Severtson · Jul 10, 2023 go to post

You should definitely avoid putting strange journal files in your local journal directory! 

As Dmitry suggested, the Journal APIs will let you read the contents of a journal file. You can also use the existing Journal Profile utility for a general sense of which globals are most active in the file.

set path = ##class(%SYS.Journal.System).GetLastFileName() //example, use any journal file
do ##class(%CSP.UI.System.OpenJournalPane).ComputeJournalProfile(path)
zw:$ZV["Cach" ^CacheTemp.JournalProfile(path)
zw:$ZV["IRIS" ^IRIS.Temp.JournalProfile(path)
Chad Severtson · Jul 11, 2023 go to post

+1 for %ResultSet being deprecated. I'd suggest using %SQL.Statement instead.

For your immediate question, it's a good practice to always check status codes. 

set status = rs.Execute()
if ('status) {
    write $SYSTEM.Status.GetErrorText(status) 
}

You also might find some information in Auditing if there is a security issue. 

Chad Severtson · Jul 11, 2023 go to post

Great solution! 
I compared the performance against querying %SYS.Journal.Records:List and found that using the objects is >10 times faster. Oddly, I couldn't execute the query via %SQL.Statement. 

TestJournalFileNext    0.777671s                              

TestJournalResultSet: 10.972615s    

Chad Severtson · Aug 3, 2023 go to post

I'm late to the party, but it looks like several had similar approaches.

 

60

ClassMethod IsValid(sAs%String) As%Boolean
{
 f{sx="()",s=$CHANGE($TR(s,$TR(s,x)),x,"") q:s'[x} qs=""
}
Chad Severtson · Aug 21, 2023 go to post

%request.Get("Top") will return the value which is stored in %request.Data("Top", 1). 

If you want to iterate through all the values, I'd use @Ashok Kumar T 's solution or $ORDER on %request.Data. 

Chad Severtson · Aug 22, 2023 go to post

Elijah has a great answer for this inquiry!

However, I would urge caution with this approach for production systems -- especially with large volumes of MessageHeaders + MessageBodies. Reading the entire corpus of messages into memory to find a particular value could have a significant impact on overall performance. 

Chad Severtson · Aug 23, 2023 go to post

Two thoughts:

  • It looks like the Daemon in question is within the WebGateway -- not on the IRIS side. 
  • It looks like RELOAD = null is hardcoded immediately after it is checked (and is equal to one). 


One question:

  • Can your change/source control fail review is RELOAD=1 is not present? 
Chad Severtson · Sep 6, 2023 go to post

I expect transactions rolled back would be missing a TCOMMIT in the journal file. Walking the journal files and counting the TSTARTS vs TCOMMITS should give you a rough number. It could be off by the number of transactions that happened to be open at the start of the period. That error margin will vary significantly based on activity. 

Chad Severtson · Oct 20, 2023 go to post

I'd love to know more about your specific use case for using 32KB blocks for the database. In my experience, 8KB blocks are generally more adaptable unless you're exclusively working with atomic data elements that are that size or larger. IMHO, it's an instance wide consideration rather than only a database level consideration because allocating buffers of 32KB reserves a portion of the memory for blocks of that size. 

Chad Severtson · Oct 30, 2023 go to post

A few thoughts: 

  1. I consider <FILEFULL> or <DSKFUL> errors to be risks for data integrity -- the system is unable to write everything attempted. This is less of a risk with IRISTEMP, especially if the entire instance fails. However, if other databases are affected, you may have some physical or logical data integrity issues to resolve. 
  2. Check your SQL query plans. I suspect you're generating some large temp tables if your IRISTEMP is the database that is filling up your disk. 
  3. IRISTEMP is special -- it tries to keep the blocks in memory as much as possible before writing them out to the disk. If you're exhausting your disk space because IRISTEMP grew too large, then Alexander is correct: some additional global buffers could help. However, if your load exceeds your capacity, the bag will eventually burst. 
  4. Setting a Maximum Size for IRISTEMP will not completely resolve the issue. However, it may make the situation more readily recoverable. If your IRISTEMP is on the same filesystem as your OS, it can be more difficult to recover without a restart. 
  5. Consider setting MaxIRISTempSizeAtStart to be be able to recover more readily by automatically reducing the size of IRISTEMP
Chad Severtson · Jan 25, 2024 go to post

Great article! I like the code snippet for more advanced automation of managing transactions.

I often suggest this query to find transactions that are open longer than is suitable for operational stability. 

SELECT * 
FROM %SYS_Journal.Transaction_List() 
WHEREDATEDIFF('s', StartTime, NOW()) > 60
Chad Severtson · Jan 25, 2024 go to post

I thought about it a bit. There are additional possible explanations depending on deployment topology and journal purge settings: 

  • Mirror member is offline
  • Backup failed
  • %SYS.Task.PurgeJournal is suspended/disabled/deleted
Chad Severtson · May 29, 2024 go to post

"You cannot create namespace-specific mappings to resources that are mapped in the %ALL namespace, as %ALL mappings override any namespace-specific mappings to the same resource." - Docs

Chad Severtson · Jun 14, 2024 go to post

I use the following to get the full query. 

SELECT Location, RuntimeLocation, Statement->Statement 
FROM INFORMATION_SCHEMA.STATEMENT_LOCATIONS 
WHERE Location  = ?
OR RunTimeLocation = ?