• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)



thanks.
 
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic