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.
-Marc
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.







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