Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
thomasnguyen
Level 7

Registry writes sometimes don't persist

Starting around mid July I've been seeing that Roku 1, 2, 3 some times don't persist registry writes even after flushing. Reading the value of a key that was written will some times return invalid and always return invalid after the first time. Here are the helper methods I'm using to write and read to and from the registry:

Function RegRead(key as String, section=invalid) as Dynamic
if section = invalid then section = "Default"
sec = CreateObject("roRegistrySection", section)
if sec.Exists(key) then return sec.Read(key)
return invalid
End Function

Function RegWrite(key as String, val as String, section=invalid) as Void
if section = invalid then section = "Default"
sec = CreateObject("roRegistrySection", section)
sec.Write(key, val)
sec.Flush() ' commit it
End Function

Has anyone else been experiencing the same problem more recently?
0 Kudos
2 Replies
EnTerr
Level 8

Re: Registry writes sometimes don't persist

How much data do you have in teh registry?
Check the result of sec.Flush() - it will fail if registry has grown past quota and that means change was not be saved.
0 Kudos
destruk
Level 10

Re: Registry writes sometimes don't persist

I think most people use those same routines. When writing a key you can specify a registry section. What I usually do is for standard data that must persist (user ID, etc) I use one section that matches the channel name, and for bookmarks or stuff that's not as important or consistently changing I add a "2" to the name - that way it's easier to debug and keys don't get inadvertently deleted. When using the same section for all registry writes in a channel I ran across some rokus that would lose data, but that's mainly due to a mistake I had in the registry sort routines I was using.
0 Kudos