Add private commit() method and improve logging.
Change some log messages to trace level.
Make clear() atomic and let isEmpty() handle a closed db.