1. I don't think we should be doing an open and close here. That is the responsibility of the caller. What we should do is assert that the database is open.
2. While we haven't do it in other places in this file, but we should probably start doing this - i.e. checking of isLoggable

if (isLoggable(getLoggerTag(), Level.DEBUG) {
  Log.d(.....)
}