User bio
404 bio not found
Member since Nov 10, 2015
Posts:
Tomas has not published any posts yet.
Replies:

Please, what is definition of your  stream property and how do you create its data?

If the stream is type of %Library.GlobalCharacterStream or %Library.GlobalBinaryStream, the location of the streams depends if you write data directly to the stream property or if you created the stream first and assign it to stream property:

Class tv.test Extends %Persistent,
{
Property MyStream As %GlobalCharacterStream;
}

USER>s x=##class(tv.test).%New()
 
USER>w x.MyStream.%Location
^tv.testS
USER>w x.MyStream.Write("My Data")
1
USER>w x.%Save()
1
USER>zw x.MyStream.GetStreamId()
$lb($c(0,16,1,11,1)_"^tv.testS"_$c(3,4,4,2,1),"%GlobalCharacterStream"

BUT:

USER>s x=##class(tv.test).%New()
 
USER>s str=##class(%GlobalCharacterStream).%New()
 
USER>w str.%Location
^CacheStream
USER>s x.MyStream=str
 
USER>w x.MyStream.%Location
^CacheStream
USER>w x.MyStream.Write("My Data")
1
USER>w x.%Save()
1
USER>zw x.MyStream.GetStreamId()
$lb($c(0,19,1,14,1)_"^CacheStream"_$c(3,4,2,2,1),"%GlobalCharacterStream")

Therefore if you do not want to change the location of the stream, is better to use CopyFrom method insterad:

USER>s x=##class(tv.test).%New()
 
USER>s str=##class(%GlobalCharacterStream).%New()
 
USER>w str.Write("My Data")
1
USER>w x.MyStream.CopyFrom(str)
1
USER>w x.%Save()
1
USER>zw x.MyStream.GetStreamId()
$lb($c(0,16,1,11,1)_"^tv.testS"_$c(3,4,5,2,1),"%GlobalCharacterStream")

Please, let us know if it corresponds to your findings.

Certifications & Credly badges:
Tomas has no Certifications & Credly badges yet.
Global Masters badges:
Tomas has no Global Masters badges yet.
Followers:
Following: