• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail Store connections pool???  RSS feed

 
Sergey Kargopolov
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I create a Connection to Store at the HttpSession creation time (ContextListener) and keep it active for all user operations with Store, Folder and Messages (while user session is active). Is it okay or I should release connection to Store when it is not needed in order not to burden Mail Server? Is there a limit to number of Connections to Mail Server?

Or I should create a pool of Store Connections or use of DataSource (Tomcat)? Can anyone share examples, tutorials?

Thank you very much!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An HTTP session might be open for a long time; you shouldn't include a connection for just a single user in it. It's certainly possible to keep a connection pool, but mail server connections are different in usage patterns than database connections. I'd do some investigations of performance before I'd conclude that a pool would be helpful. DataSource is just for database connections, so it doesn't help in this situation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!