Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transactions with Spring and Hibernate  RSS feed

 
Jim Baker
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Hibernate3 with Spring2. Both Hibernate and Spring handles the
transaction, which should be used? Or both?

I'm currently using Hibernate transaction through a datasource. The Hibernate
DAO is injected in the service class through Spring.
 
Nick Williamson
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I would do it: have a base bean that all your services can extend your transaction service so your transactions are at the service level. I'd be interested to see another way of doing this.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!