What is the difference between Session.getDefaultInstance(props, authenticator)
and getInstance(props, authenticator)
? In general, when will you choos
If you read the documentation, you will see that
getDefaultInstance Get the default Session object. If a default has not yet been setup, a new Session object is created and installed as the default.
Therefore, if one does not already exist, it call getInstance()
getInstance Get a new Session object.
So, a new session object is created, regardless of whether one already exists.