I have an application that connects to a database and retrieves information from it. The way it is written is: for every request received, create a new connection to the DB server and retrieve data.
When testing, if the network cable is removed from the host, and reconnected, the application goes back to retrieving data normally. However, if the "connected" option is unchecked and rechecked to simulate a disconnection, the application cannot connect to the database again, even though all handlers etc are created for each connection.
Question: Is disconnecting the network cable from the host different than unchecking the "Connected" option in VM configuration?
No there should be no difference, but if you have transient ports set on your switch it may give you a new port number which may effect the network reconnection in an unexpected manner. The vswitches don't act like normal switches either, they are more aware of the VM configuration state, so may also be effecting what happens. You would run a wireshark on a port that is in promiscuous mode to try to isolate the problem.
No, there is no difference. Unchecking 'Connected' is just breaking the virtual link between the card and vSwitch: