Checking if resultset closed before logging ID of record throwing an error. Bug 792:resolved