• 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

Use of MDBs for sending EMails

 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

At present i am Using Session Bean for sending Emails, in my application. This session Bean is not part of any transactions. Sending Emails sometimes takes lot of time, will it be a good idea to use MDBs for this purpose?
I was also thinking to send emails in a seperate thread from SessionBean, (Although starting new threads are not recommended according to Suns specs) but since my Session Bean is not part of any transaction i think using threads should not be a problem.
please advice

thanks
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would recommend going with your first idea: use MDBs. We do the same thing here to send emails to users when they change various parts of their accounts. It's not a good idea to create your own threads in a J2EE container not due to transactions but because the container manages them itself.

It's another case where you can do it, but you might be setting yourself up for disaster later. MDBs are so easy to use that it's not worth the risk in my view.
 
reply
    Bookmark Topic Watch Topic
  • New Topic