13.07.2015 Views

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Developers11.2.6.17 %DeleteExtent() Behavior ImprovedIn prior versions, the %DeleteExtent() method always returned $$$OK, even if not all instances in the extent were deleted.In version 5.1, its behavior now better matches expectations; it only returns $$$OK if all instances of the extent were successfullydeleted.11.2.6.18 Method Compilation And Return ValuesIn previous versions, if a method was declared to return a value, the method compiler would insert aQuit ""if the last line of the method did not begin with a Quit command. This approach, however, hid subtle programming bugsbecause the method the developer wrote did not, in fact, return a value when it was supposed to.In version 5.1, this is no longer done. The method compiler will only insert a simpleQuitinstead if the last line of the method does not contain one. Thus, invoking a method (function) that does not return a valuewhen it is declared to will result in a error.11.2.6.19 Required Relationship Collections Cannot Be EmptyIf an application specifies that a “child” or “many” side of a relationship collection is required, <strong>Caché</strong> now make surethis contains at least one element. If the relationship is empty at the time the instance is saved, <strong>Caché</strong> reports an error on%Save, for example:ERROR #5662: Relationship child/many property 'Sample.Company::Employees(1@Sample.Company,ID=)' is required so must have at least one member11.2.6.20 Cycle Checking For XML ExportsIn <strong>Caché</strong> 5.1 XML-enabled classes check their hierarchy before export to determine if there is a cycle present. This checkis on by default, but may be disabled by appending “,nocyclecheck” to the Format property of %XML.Writer.Note:If this check is disabled, and a cycle is present, a error will result.11.2.6.21 Task ChangesTask Manager Hierarchy <strong>Upgrade</strong>dThe Task Manager now uses the <strong>Caché</strong> class hierarchy more completely. All user tasks must now subclass the class,%SYS.Task.Definition.Subclasses can thereby introduce additional properties which will be available during the task execution. The user interfacewill then interrogate the definition to request the property values from the user. For example,Class %SYS.Task.IntegrityCheck Extends %SYS.Task.Definition{Property Directory As %String [ InitialExpression = {$zu(12)} ];Property Filename As %String [ InitialExpression = "INTEGRIT.LOG" ];ClassMethod DirectoryIsValid(Directory As %String) As %Status{If '##class(%Library.File).DirectoryExists(Directory)}{Quit $$$ERROR($$$GeneralError,"Directory does not exist")}Quit $$$OK/// This method is responsible for executing the task/// At the scheduled time, the Task Manager/// - creates an instance of this object,<strong>Caché</strong> <strong>Upgrade</strong> <strong>Checklists</strong> 257

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!