How to properly manage VIJAVA ServiceInstance connection

481 views Asked by At

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?

1

There are 1 answers

0
moriya On

Establishing new connection will influence the performance. On the other hand if you will have one connection and it will stay open, you may have security issues in case password of vCenter has changed and your connection will remain open. I think that the best solution is to use one connection, but manage the timeout of the connection. And then close it when you have timeout and reopen it.