Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

Jigar Gosar
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 and other

and send a mail using this Default session object, then all the mails are send using mail server, even if i later pass a different property object containing 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)

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic