Checking the connection before attempting rollback 

Checking the connection before attempting rollback  allows for validating the log file while not connected.