Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get connection at each request?  RSS feed

 
Amy N. Snow
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.
 
Tim Holloway
Bartender
Posts: 18662
71
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.
 
Himanshu Gupta
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.
 
Victor Bucutea
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 .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!