I'm in need of some guidance on managing vijava ServiceInstance connection. I'm creating a GUI application which allows the end user to manage, create and modify VMs from vCenter. So, when the application first launches, the user enters IP address of vCenter server, username and password. I create a ServiceInstance object to create the connection. Once the connection is establish, I leave it open for the user to perform tasks until the application is closed where terminate the session by login out.
My questions is, should I establish a connection every time the user needs to perform a task that requires a connection to vCenter and then log out once the task is complete? Or just establish one connection and use that same connection to perform tasks and terminate the session when the application closes?