Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb and 1.000.000 users  RSS feed

 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I've got (i.e.) 1.000.000 users.
I want to get their mail address in order to send them a newsletter.

1) May I use an EJB-QL statements to get the whole mail address Collection
and send mail while iterating on its elements?

2) Should I take care of some sort of algo/consideration in order to
reduce the impact of the operation?

3) In order to speed up the operation may I make some configuration in JBoss (i.e. thread pool)?

Thanks a lot.
Marcus
 
Senthil Somasundaram
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) May I use an EJB-QL statements to get the whole mail address Collection
and send mail while iterating on its elements?


It's bad idea to use EJB in this context..Create your own JDBC class
to retrieve the email address from Database.

As sending 1,000,000 emails will affect your SMTP server, try to split up the number of mails you are going to send.

Hope this will help.


 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) May I use an EJB-QL statements to get the whole mail address Collection and send mail while iterating on its elements?

As said in previous posting use DAO pattern. You can think of using read only pattern with EJB if you are using weblogic, but I don't know about performance impact.

2) Should I take care of some sort of algo/consideration in order to
reduce the impact of the operation?

3) In order to speed up the operation may I make some configuration in JBoss (i.e. thread pool)?


Yes you must have to use algoritham
Either by using Threads or by using Asychroneous Processing(Message Driven Bean). You have to distribute your mails among various threads.
 
marcus don
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!