Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
roquoonewbie
Visitor

roRegistry Transient Storage

Where in the docs does it explain how to specify that a Write operation for roRegistry should be transient, as described in the component reference manual? Other than this paragraph below, the word "transient" does not appear anywhere else in the doc, and I cannot find how to specify a write to be transient as described here:


"The Registry also supports the use of a special “Transient” registry section. This registry section allows the application to store attributes that have the lifetime of a single boot. Within a specific boot session, these values will be persistent to the application and stored as any other registry value. Whenever the user reboots the Roku Streaming Player, the “Transient” registry section is removed and the values no longer persist. This technique is useful for caching data to minimize network access, yet still ensuring that this data is always fresh after a system reboot."
0 Kudos
11 REPLIES 11
gonzotek
Visitor

Re: roRegistry Transient Storage

I **think** (I'm not near a Roku to test and verify right now) you just use the string "Transient" when creating the roRegistrySection object, e.g.:
CreateObject("roRegistrySection", "Transient")
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
RokuMarkn
Visitor

Re: roRegistry Transient Storage

To store transient data, just store it in the section named "Transient".

--Mark
0 Kudos
roquoonewbie
Visitor

Re: roRegistry Transient Storage

That makes sense. Thank you.
0 Kudos
EnTerr
Roku Guru

Re: roRegistry Transient Storage

Is "Transient" subject to the 16kB registry limit?
0 Kudos
RokuMarkn
Visitor

Re: roRegistry Transient Storage

Yes, the only thing special about "Transient" is that it is automatically deleted at boot time.

--Mark
0 Kudos
Komag
Roku Guru

Re: roRegistry Transient Storage

Has this changed? Because I was able to store a much larger amount of data than 16KB and it persisted over channel sessions but was lost on reboot. I never specified "transient" as the section name, but maybe it defaulted to that when trying the flush() since it saw the data amount was too big for the regular registry?

viewtopic.php?f=34&t=87869#p495753
EDIT - fixed link
0 Kudos
EnTerr
Roku Guru

Re: roRegistry Transient Storage

Your link does not point right but I assume you meant viewtopic.php?f=34&t=87869#p495753

If you didn't use "transient" as section name, then you are experiencing something else - something that is a bug, omission, undocumented - and as such subject to change, so don't rely on it in your code. Same goes on being able to store >16KB in the registry because of the gzip implementation. I say don't rely on that, be prudent in your choice.

On a side note, amusing thought - formatJSON() will likely give you a close estimate of how big the registry storage (keys and values) will be pre-compression.
0 Kudos
Komag
Roku Guru

Re: roRegistry Transient Storage

Agreed, I won't be relying on unreliable stuff! 8-)

I have been thinking I may use FormatJson() and ParseJson() once I get my formatting set and information ducks lined up. Its gonna be a while 😉
0 Kudos
RokuMarkn
Visitor

Re: roRegistry Transient Storage

When this happens does your Flush() call return true or false?

--Mark
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.