Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

spring and hibernate  RSS feed

 
Billy Vandory
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a db pool running on my app server and want to use spring config to do a jndi lookup (jee to the datasource and also supply the EntityManagerFactory.. All the examples I've seen require a servlet to be used to bootstrap spring.

Is this the normal way to do it, with a servlet? Let's say the dao layer doesn't have a presentation layer, should the servlet still be used to bootstrap spring?

thanks

Billy
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy Vandory wrote:

Is this the normal way to do it, with a servlet? Let's say the dao layer doesn't have a presentation layer, should the servlet still be used to bootstrap spring?


No. I don't use a servlet to get Spring's ORM objects created and configured in JSF. The Spring config file along with suitable annotations on my persistence layer classes is all I need.

Besides. My "DAO layer" doesn't have a "presentation layer" anyway. They're both layers. no layer "has" another layer.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!