Forums Register Login
is creating new sessions a heavy weight process???

i create sessions using Session.getInstance instead of Session.getDefaultInstance, cause my smtpHost might change per mail that is send. so tell me is creating session object per mail ,a heavy weight process.

also if i call Session.getDefaultInstance(props); with different props object ,( one contains mail.smtp.host=smtp.foo.com and other mail.smtp.host=smtp.goo.com)

and send a mail using this Default session object, then all the mails are send using smtp.foo.com mail server, even if i later pass a different property object containing smtp.goo.com when calling getDefaultInstance().

but i dont find this problem, when i use getInstance() instead of getDefaultInstance().

so i wnat to know whether getInstance() is a heavyweight operation, (per mail)

Is that a spider in your hair? Here, threaten it with this tiny ad:
Download Free Java APIs to Work with Office Files and PDF

This thread has been viewed 465 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 13, 2018 04:26:59.