• Post Reply Bookmark Topic Watch Topic
  • New Topic

is creating new sessions a heavy weight process??????  RSS feed

Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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)

Popeye has his spinach. I have this tiny ad:
Rocket Oven Kickstarter - from the trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!