TinyDB-problem with iOS

Dear community,

using the TinyDB I have the following problem: It seems, that the first TinyDB defined in a screen does not work:
In the attached two images you see the blocks of two screens. The task is to transfer two inputs from screen1 to screen 2. Using the first defined TinyDB1, the transfer does not work. If I use TinyDB2, the second defined TinyDB in both screens, the transfer of the variables works.
A workaround is very simple: just don’t use the first defined TinyDB. But, this should not be the longterm solution. Hopefully someone can test the aia on his iOS system and the problem can be fixed. Or am I doing something wrong?
I look forward to your answers

Marcus

Figure 1: screen1:
screen1

Figure 2: screen2:

The aia program:
TinyDBtest.aia (3.4 KB)

I think this is currently a bug in how TinyDB is implemented on iOS rather than Android. On Android, each operation opens and closes the XML file used to store TinyDB values. On iOS, it is implemented as a sqlite database, but each component tries to grab a reference to the same file. If you're including more than one TinyDB on a screen, only the last one will have the write lock for updating most likely, which is why you would see this behavior. What is the particular purpose of using more than one TinyDB? Did you specify a different Namespace? Otherwise there's no difference between using two instances versus a single instance.

1 Like

99% of the time it's because people find it easier to understand. They don't have to worry about Namespace because each instance of TinyDB has it's own Namespace by default. So if you have unrelated lumps of data to store, it's logical to store them 'separately' in 'separate' TinyDBs.

This is false.

:+1:

image

image

1 Like

The simple reason for using two TinyDBs was, that it did not work with one.
But I think, I found my error: I used different names for the TinyDBs in the screens. I have now just one TinyDB and named them the same in the screens. This works (in many cases).
But, to be open, with two TinyDBs I have less crashes of the app than with one!
Many thanks for your kind support!

Marcus

Of course, in the end this is still a bug and we should figure out how to fix it. Thank you for the report.

Sorry guys my bad - that's what comes from working too long and too late - you do have to name Namespaces yourself -

Snap2

It is convenient to work like this.

I gave the TinyDB now the same name in the two screens and it works perfect. I cannot find out, why it did not work properly yesterday (maybe tested too quick with too less time :wink: .
Just for information: When I have started I created for every variable to transfer a new TinyDB, in sum six TinyDBs. Five of them worked, but the first one not. That was the reason, why I started this topic. So, using one TinyDB and giving the different variables different names is the correct way.
Thanks all of you for your kind support!

Marcus

1 Like