Hello Sisinda

Le 28/06/2017 à 14:20, Sisinda Dinusha a écrit :

> Currently I am working on porting JDBC to SQLite connectivity in
> sis-metadata and sis-referencing modules. I will try tests as soon as
> this gets done.
>
Thanks.


> I assume that SQLiteOpenHelper should go into the sis-metadata module
> because Initializer class manages the database instance. Android
> SQLiteOpenHelper class provides onCreate method which runs when the
> database is created for the first time. That's where table creation
> and data feeding scripts typically goes. In our case, I don't think we
> can use that method because the installation scripts are in
> sis-referencing module. So I'll avoid that method and let
> sis-referencing module create the tables, as how it is done in trunk.
>
Actually it is still possible to initialize EPSG database even from the
sis-metadata module, using java.util.ServiceLoader. Is the later class
presents on Android?

A question however is whether we want the database to be populated when
the database is created, or a little bit later when an EPSG code is
requested for the first time. SIS currently defers EPSG schema creation
as much as possible since the database could be created for other
schemas than the EPSG one, but I'm not sure it was a good idea because
it may cause a long application freeze (about 1 minute) at any time
instead than closer to startup time. Maybe it would be a good idea to
use SQLiteOpenHelper.onCreate(…) actually. I'm interested in particular
to the following paragraph in SQLiteOpenHelper documentation:

    This class makes it easy for ContentProvider implementations to
    defer opening and upgrading the database until first use, to avoid
    blocking application startup with long-running database upgrades.

I have no strong opinion about whether we should use onCreate(…) or not.
What do you think?

Martin


Reply via email to