User bio
404 bio not found
Member since Nov 6, 2015

Standalone installers for Caché ODBC drivers are available on the software distribution page in the WRC.

Hi Rochdi,

You don't need to use %File and then copy it to a file stream. You can just use %Stream.FileCharacter to directly open and read the file:

  Set stream=##class(%Stream.FileCharacter).%New()
  Set sc=stream.LinkToFile("c:\myfile.txt")
  While 'stream.AtEnd {
  Set line=stream.Read()
  ; Process the chunk here

And I can confirm that I've also seen %Stream.FileCharacter significantly outperform %File for reads.


I suspect the problem is that you're using a %DynamicObject. BPLs should use persistent/persistable objects because business process execution can in some cases be suspended temporarily and then resumed. Before execution is suspended, context objects are saved into the DB.

%DynamicObjects are not persistent objects, so their values are lost when execution is suspended. You can overcome this by using %ToJSON to serialize the %DynamicObject into a stream property of the context object. Streams are persistable.

The life cycle of a business process requires it to have certain state information saved to disk and restored from disk, whenever the business process suspends or resumes execution. This feature is especially important for long-running business processes, which may take days or weeks to complete.
Open Exchange applications:
Marc has not followed anybody yet.
Global Masters badges: