Use of ThreadSafeDatabase

15 views
Skip to first unread message

Peter

unread,
Aug 19, 2017, 3:09:32 PM8/19/17
to CodenameOne Discussions
Hi,
I have a few questions about the ThreadSafeDatabase.

1. How often do I need to close() the db?  Would it be a problem if I kept a static reference to an open database, and only closed it when the app enters either stop() or destroy()?

2. In Eclipse, the source for ThreadSafeDatabase.commitTransaction() calls:
    underlying.beginTransaction(); // not commitTransaction...?
Is this a bug?

3. I would love to read a blog post or documentation that elaborates on differences between sqlite in android vs ios.  I've never used sqlite before and hope that my use case is simple enough that I wouldn't run into any incompatibilities, but more detailed guidance (for a beginner, please!) would help me, and probably others.

Thanks,
Peter

IDE: Eclipse

Shai Almog

unread,
Aug 20, 2017, 12:17:12 AM8/20/17
to CodenameOne Discussions, boreal...@gmail.com
Hi,
1. destroy() is bad. You can use stop()/start() as destroy() isn't guaranteed.
That's possible.

2. Yes, thanks we'll fix it.

3. Unfortunately it's too nuanced since the OS's changed the behavior between versions. One of the problems we know about relates to transaction isolation which has different default values in both OS's. Not exactly light reading.
Reply all
Reply to author
Forward
0 new messages