Filipe's application would worked fine when initially run but if he popped back out of it and then immediately ran it again, it would throw "database ... already closed" exceptions. Because the application destroyed all of its views, the underlying helper and database would be closed when the main view was left. He was using the inner static object cache, and because the application was still resident, the cache still had objects. Since ForeignCollections have an inner DAO reference, when he ran the application again, any reference to the foreign collections (especially if lazy) would reference the closed database -- not the re-opened one. ORMLite now automatically flushes all of static object caches (and the DaoManager) when the helper is reconstructed. If you have are constructing your own caches you must make sure they are cleared in the main view onCreate().
But I think there is an interesting warning that needs to be understood and could affect JDBC users as well. If you are using object caches, especially the static inner one, you must clear them if you create another ConnectionSource to another database shard or something that you clear the object caches. To clear the static cache you can do:
BaseDoaImpl.clearAllInternalObjectCaches();
Comments? Questions?
gray