Better handling of the connection state for atomic transaction block