Methods like Row.getString throw this error.

java.io.IOException: ResultSet closed
at com.codename1.impl.javase.SECursor.getString(SECursor.java:269)
at 
com.codename1.db.ThreadSafeDatabase$RowWrapper$7.run(ThreadSafeDatabase.java:216)
at com.codename1.db.ThreadSafeDatabase$3.run(ThreadSafeDatabase.java:97)
at com.codename1.util.EasyThread$3.run(EasyThread.java:128)
at com.codename1.util.EasyThread$1.run(EasyThread.java:63)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)


Is there something different I should be doing to use ThreadsafeDatabase? I 
just had all my database code working without the threadsafe db and then 
wrapped my db instance:

db = new ThreadsafeDatabase(unsafeDb);

Where db is a Database instance that is kept for the duration of the app 
running (property of a Singleton) and all database actions go through that 
same singleton.

Previously I used native code to manage this problem by using the following 
Objective-C to switch SQlite to the same mode as Android and it worked fine 
but if there is a good CN1 way to do it I'd rather do that if I can get it 
working:

-(void)initDatabase{
    sqlite3_shutdown();
if (sqlite3_config(SQLITE_CONFIG_SERIALIZED) == SQLITE_OK) {
    NSLog(@"sqlite configured to be threadsafe");
}
sqlite3_initialize();
}


-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/322c4cc3-0b43-479a-bb61-2cf4bb665c61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to