mardi 3 février 2015

Android, difference between `database.close()` and `close(database)`?

I've been working with SQLite Databases in android. I've got something like:



SQLiteDatabase database = open();
database.beginTransaction();

... do work ...

database.setTransactionSuccessful();
database.endTransaction();


And then at the end I would close the database. I've seen both close(database);, as well as database.close();


Is one better, faster, more efficient that the other? Why do much redundancy, if they do the exact same thing?


Aucun commentaire:

Enregistrer un commentaire