• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get connection at each request?  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSP with the servlets I could open and close the connections when the request started and ended. How can I do the same with JSF?


Thanks.
 
Saloon Keeper
Posts: 19011
80
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connections to what?
 
Amy N. Snow
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, to a database.
 
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSF you have Backing Bean to do all the server related Tasks.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why you would need to open and close a connection to your database after each response/request cycle .

If I where in your place ( supposing a persistence api like Hibernate is out of the question ) i would place a Singleton with a database connection and a servlet which opens/closes and manages db connection at each request .
 
Your mind is under my control .... your will is now mine .... read this tiny ad
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!