close operation fix, not run the commit if the db is already closed.