Close database transaction when _callback stops.