• Post Reply Bookmark Topic Watch Topic
  • New Topic

Example of SevletContextListener  RSS feed

 
Muni K Reddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,
Could you please tell me when it becomes necessary to initialize a database connections using a ServletContextListeners.
Is it frequently used in the Industry?
Many Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The industry standard is to use container managed connection pooling.
This doesn't require doing anything in a context listener.

If you were implementing your own connection pool then a contextListener would be a great place to initialize it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!