Announcement Announcement Module
Collapse
No announcement yet.
Spring Transaction Management or Hibernate Transactions? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Transaction Management or Hibernate Transactions?

    Hello. I'm developing a web app using Spring MVC + Spring IoC + Hibernate.

    Should I use Hibernate's Transaction directly (i.e. beginTransaction and commit) or use Spring's Transaction Management?

    Is one better for single databases versus across tiers?

  • #2
    Should I use Hibernate's Transaction directly (i.e. beginTransaction and commit) or use Spring's Transaction Management?
    Using Spring to manage your transactions declaratively is probably more flexible. Spring just uses Hibernate Transactions underneath (but you can also easily scale upto JTA if needed).

    Is one better for single databases versus across tiers?
    Spring can handle distributed transactions as well (as can Hibernate). See the reference: Do you need an application server for transaction management?

    Comment

    Working...
    X